mysql完全卸載
sudo apt-get autoremove --purge mysql-server-5.5
sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get remove mysql-common
清除殘餘
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
ubuntu mysql 主從注意一定要註釋掉配置文件裏面的:
bind-address = 127.0.0.1
要實現遠程連接mysql:
ubuntu mysql會默認綁定在localhost或者127.0.0.1 上面 已安全模式啓動
要想遠程連接 就要註釋掉my.cnf裏面的bindaddress
而且將hosts文件裏面的127.0.0.1註釋掉或者調到下面去 hosts文件按順序解析
刪除表數據 兩種方式:
TRUNCATE TABLE 表名
delete
delete可以用where控制刪除,但速度沒有TRUNCATE 快
查看mysql配置參數:
show status,show variables,flush status
show status like
show variables like