使用 yum 命令安装 mysql

来源:互联网 发布:淘宝全球购 税 编辑:程序博客网 时间:2024/04/29 15:07

1. 使用 yum 命令安装 mysql

yum   -y install mysql-server

2. 查看一下有没有mysql服务

chkconfig --list | grep mysql

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

3. 启动mysqld

/etc/init.d/mysqld start

starting MySQL:                                                           [ok]

4. 修改root账号密码

mysqladmin -u root password '123456'

5. 连接到mysql

mysql -u root -p    

输入密码

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

原创粉丝点击