登录
首页 >  数据库 >  MySQL

centos安装mysql

来源:SegmentFault

时间:2023-01-29 14:41:29 298浏览 收藏

数据库小白一枚,正在不断学习积累知识,现将学习到的知识记录一下,也是将我的所得分享给大家!而今天这篇文章《centos安装mysql》带大家来了解一下centos安装mysql,希望对大家的知识积累有所帮助,从而弥补自己的不足,助力实战开发!

一、查看mysql版本

yum list | grep mysql

二、安装mysql

yum install -y mysql-server mysql mysql-deve

Installed:
  mysql.x86_64 0:5.1.73-8.el6_8                                                              mysql-server.x86_64 0:5.1.73-8.el6_8                                                             

Dependency Installed:
  perl.x86_64 4:5.10.1-144.el6                   perl-DBD-MySQL.x86_64 0:4.013-3.el6           perl-DBI.x86_64 0:1.609-4.el6             perl-Module-Pluggable.x86_64 1:3.90-144.el6        
  perl-Pod-Escapes.x86_64 1:1.04-144.el6         perl-Pod-Simple.x86_64 1:3.13-144.el6         perl-libs.x86_64 4:5.10.1-144.el6         perl-version.x86_64 3:0.77-144.el6                 

Dependency Updated:
  mysql-libs.x86_64 0:5.1.73-8.el6_8                                                                                                                                                           

Complete!

三、启动mysql服务

service mysqld start

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

四、设置开机启动

chkconfig mysqld on

五、查看是否开机启动

chkconfig --list | grep mysqld

mysqld             0:off    1:off    2:on    3:on    4:on    5:on    6:off

六、设计root密码

/usr/bin/mysqladmin -u root password 'qwerzxcv'

七、登录数据库

mysql -u root -p

Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

八、centos7安装mysql

  • 在安装前执行命令:
sudo rpm -Uvh http://dev.mysql.com/get/mysq...
  • 然后正常安装mysql

文中关于mysql的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《centos安装mysql》文章吧,也可关注golang学习网公众号了解相关技术文章。

声明:本文转载于:SegmentFault 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>
评论列表