MySQL配置与启动

173 阅读1分钟

1.安装MySQL

yum install mysql mysql-server

2.启动MySQL

service mysqld start

3.配置MySQL

/usr/bin/mysql_secure_installation
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

4.连接MySQL

mysql -uroot -pyourpassword

5.创建可以外部连接的用户

create user IDENTIFIED BY 'password'