linux平臺mysql安裝操作
mysql初始設定
1.檢視防火牆是否開啟3306埠 iptables -L -n 檢視 vim /etc/sysconfig/iptables 編輯防火牆配置 service iptables stop --停止 service iptables start --啟動
systemctl stop iptables systemctl start iptables systemctl restart iptables systemctl reload iptables
2.檢視mysql 是否監聽3306埠 netstat -an | grep 3306 檢視所有3306埠使用情況 ps -ef |grep mysql 檢視一個服務執行狀態 如果沒有設定socket、port 需要設定etc/my.cnf
3.檢查使用者訪問許可權 mysql> use mysql; Database changed mysql> update user set host='%' where user='root'; mysql> flush privileges; 4.lower_case_table_names引數詳解: 0:區分大小寫 1:不區分大小寫
5.匯入資料庫 mysql>source /home/xxxx/dbname .sql;
Innodb和MyIASM zhongsher jgk%@Jgjr3h
SET PASSWORD=PASSWORD('[email protected]
mysql常用命令 systemctl start mysql.server 啟動mysql服務
/usr/local/mysql/bin/mysql -u root -p
啟動方法: [[email protected] ~]# cp mysql-5.5.34/support-files/mysql.server /etc/init.d/mysql [[email protected] ~]# chmod u+x /etc/init.d/mysql [[email protected] ~]# service mysql start
老是啟動不了,就多執行一次 bin/mysqld --initialize --user=mysq 初始化
4.進入mysql bin/mysql -u root -p
5.遠端 bin/mysql -h 172.19.18.9 -P 3306 -u root -p bin/mysql -h 47.100.61.154 -P 6161 -u root -p