1、安裝html
http://jingyan.baidu.com/article/425e69e6bbc6c7be14fc1640.htmlmysql
2、遇到的問題sql
(1)lost connection to mysql server at reading initial communication packet system error:0bash
http://www.jb51.net/article/51480.htmsocket
啓動mysql 報錯:this
(2)ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)spa
一、先查看 /etc/rc.d/init.d/mysqld status 看看MySql是否已經啓動..net
二、肯定你的mysql.sock是否是在那個位置,
mysql -u 你的mysql用戶名 -p -S /var/lib/mysql/mysql.sockcode
三、試試:service mysqld start (我遇到的是這種狀況)server
四、若是是權限問題,則先改變權限 #chown -R mysql:mysql /var/lib/mysql
[root@localhost ~]# /etc/init.d/mysqld start 啓動 MySQL: [ 肯定 ] [root@localhost ~]# mysql -uroot -p
(3)host 'xxx.xx.xxx.xxx' is not allowed to connect to this mysql server
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' -> WITH GRANT OPTION; mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass'; mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' -> WITH GRANT OPTION;
(3)1405-Access denied for user (using password: YES)
ip沒有訪問權限
use mysql; select host, user from user;