linux搭建mysql服務器的方法
1.首先,在Linux命令行中使用yum命令,安裝mysql服務;
yum install -y mysql-server mysql mysql-devel
2.等待mysql服務安裝好后,開啟mysql服務,并mysql服務進行重啟;
service mysqld start
service mysqld restart
3.mysql服務重啟后,將mysql服務設置成為開機自啟;
chkconfig --list | grep mysqld
chkconfig mysqld on
4.mysql服務設置好后,登錄mysql;
mysql -u root -p
5.登錄到mysql后,在mysql中配置外網訪問權限;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
6.外網訪問權限配置好后,修改mysql的登錄密碼;
UPDATE mysql.user SET password=PASSWORD('newpassword') WHERE User='root';
7.最后,密碼修改好后,對mysql進行更新即可;
FLUSH PRIVILEGES;