mysql开局配置
2019獨角獸企業重金招聘Python工程師標準>>>
1.安裝
//查看是否安裝
rpm -qa|grep -i mysql
//安裝mysql
rpm -ivh --force? server*******.rpm
rpm -ivh --force? client*******.rpm
//查看是否安裝成功
rpm -qa|grep -i mysql (出現server*與client*及lib說明安裝成功)
2.初始化root密碼
//使用default配置文件
mv /etc/my.cnf /etc/my.cnf.bak
//停止沒有散去了服務
service mysql stop
//使用安全模式啟動mysql
mysqld_safe --skip-grant-tables&
//配置mysql默認密碼為空
UPDATE user SET password=PASSWORD("") WHERE user='root';
FLUSH PRIVILEGES;
正常重啟mysql? ?service mysql restart
SET password=PASSWORD('');
FLUSH PRIVILEGES;
3.添加數據庫用戶
CREATE USER 'username'@'%' IDENTIFIED BY 'password';
GRANT ?ALL ON *.* to username@'localhost' IDENTIFIED BY 'passwoerd';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
?
轉載于:https://my.oschina.net/mylife993/blog/1635501
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
- 上一篇: 给网页去色
- 下一篇: Golang入门教程(十五)指针