mysql 配置
一、安裝mysql
1、 apt-get install mysql-server
2、apt-get install mysql-client
3、apt-get install libmysqlclient-dev
?
二、查看字符集
show variables like '%character%'
?
三、修改數據庫編碼
1、編輯配置文件
vim /etc/mysql/my.cnf
2、修改或添加下面三個部分
[mysqld]
character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
3、重啟mysql服務
service mysql restart
四、數據庫重置密碼
?參考:https://blog.csdn.net/mycwq/article/details/17262655
?
五、遠程鏈接數據庫1130錯誤
1、服務器3306端口確定打開
2、登陸遠程服務器,打開mysql客戶端
3、執行命令
? ? ? ? ? ? ?GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '您的數據庫密碼' WITH GRANT OPTION;
? ? ? ? ? ?在執行下
? ? ? ? ? flush privileges;
? ? ? ? ?這個命令是刷新一下權限,不用重啟
Centos 參照??https://www.linuxidc.com/Linux/2016-09/134940.htm
?
?
?
轉載于:https://www.cnblogs.com/fudou/p/8918553.html
總結
- 上一篇: Linux软件安装的补充
- 下一篇: CentOS探索之路2---使用rpm安