MySql
参考:
http://jingyan.baidu.com/article/c843ea0b96f01877931e4a1d.html
http://jingyan.baidu.com/article/48a42057e2b2b9a9242504a2.html
-----------------------------start--------------------------------
lidongliangdeMacBook-Pro:~ lidongliang$ mysql -u root -p
Enter password: *
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
说明没有权限写 /tmp/mysql.sock
需添加这个cd /usr/local/mysql/bin/mysql
修改该文件夹下my.cnf文件 添加socket = /tmp/mysql.sock
lidongliangdeMacBook-Pro:~ lidongliang$ mysql -u -roo -p
Enter password:
ERROR 1045 (28000): Access denied for user '-roo'@'localhost' (using password: YES) --> 无需输入密码 回车即可
lidongliangdeMacBook-Pro:~ lidongliang$ mysql
-----------------------------stop--------------------------------
lidongliangdeMacBook-Pro:~ lidongliang$ su
Password:
sh-3.2# mysql -u -root -p
Enter password:
ERROR 1045 (28000): Access denied for user '-root'@'localhost' (using password: YES) --> 密码是空 回车
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) --> 修改密码 或者 没有这个账号
http://www.bitscn.com/pdb/mysql/201403/195024.html Mac卸载mysql的方法
先停止所有mysql有关进程。 打开控制台:
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
vim /etc/hostconfig and removed the line MYSQLCOM=-YES-rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.* 最后这条很多文章都丢了,切记切记。
/usr/local/mysql/my.cnf
[mysqld] 添加 character-set-server=utf8
mysql 教程
http://c.biancheng.net/cpp/html/1441.html