ubuntu下mysql的小知识点

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 -|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 


你可能感兴趣的:(mysql,ubuntu)