http://blog.csdn.net/typa01_kk/article/details/49107407

问题1:

[root@Tony_ts_tian bin]# mysqladmin -uroot password 'kaka123'
mysqladmin: connect to server at 'localhost' failed
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)'
[root@Tony_ts_tian bin]# MySQL
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@Tony_ts_tian bin]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YES)

问题1.1:

发现mysql数据库下user表中,Host和User为两个主键列。

mysql> update user set host='%' where user='root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

解决1(7:忘记密码):或者MYSQL拒绝访问

先打开一个centos终端,输入如下命令

[root@Tony_ts_tian bin]# service  mysqld  stop   

Shutting down MySQL.. SUCCESS!   

[root@Tony_ts_tian bin]# mysqld_safe --user=root --skip-grant-tables --skip-networking &  

[1] 30273  

[root@Tony_ts_tian bin]# 151013 15:40:40 mysqld_safe Logging to '/var/lib/mysql/Tony_ts_tian.err'.  

151013 15:40:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

注:--skip-grant-tables启动mysql时不启动grant-tables,授权表

   --skip-networking关闭MySQL的TCP/IP连接方式,跳过网络

注:不要关闭上一个终端,再次打开一个终端。


执行以下指令:

root@Tony_ts_tian init.d]# mysql -u  root  

mysql>use mysql  

mysql>UPDATE user SET Password=PASSWORD('kaka321') where USER='root';  

mysql>flush privileges;  

mysql>quit  

[root@Tony_ts_tian bin]# service mysqld start  

[root@Tony_ts_tian bin]# service mysqld restart  

[root@Tony_ts_tian bin]# mysql -u root -p  

Enter password:  

………………ok.

或者:

UPDATE `userSET Host='%' WHERE Host='127.0.0.1' AND User='root' 

注:也可使用:/etc/mysql/debian.cnf文件中[client]下配置的密码。

问题2:

mysql> use mysql
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

解决2:

mysql> SET PASSWORD = PASSWORD('kaka321');

Query OK, 0 rows affected (0.00 sec) 

修改后继续使用。

问题3:

mysql> INSERT INTOmysql.user(Host,User,Password)VALUES("10.155.123.55","kaka",PASSWORD("kaka123"));

ERROR 1364 (HY000):Field 'ssl_cipher' doesn't have a default value

mysql> INSERT INTOmysql.user(Host,User,Password,ssl_cipher) VALUES("10.155.123.55","kaka",PASSWORD("kaka123"),"");

ERROR 1364 (HY000):Field 'x509_issuer' doesn't have a default value

mysql> INSERT INTOmysql.user(Host,User,Password,ssl_cipher,x509_issuer)VALUES("10.155.123.55","kaka",PASSWORD("kaka123"),"","");

ERROR 1364 (HY000):Field 'x509_subject' doesn't have a default value

mysql> INSERT INTOmysql.user(Host,User,Password,ssl_cipher,x509_issuer)VALUES("10.155.123.55","kaka",PASSWORD("kaka123"),"","");

ERROR 1364 (HY000):Field 'x509_subject' doesn't have a default value

解决3

mysql> INSERT INTO mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) VALUES("10.155.123.55","kaka",PASSWORD("kaka123"));  

Query OK, 1 row affected (0.03 sec)  

问题4:

ERROR 1044 (42000): Access denied for user ''@'localhost'to database 'weloveshare'

解决4

[root@Tony_ts_tian bin]# mysql -u root -p;  

Enter password:   

Welcome to the MySQL monitor.  Commands end with ; or \g.  

Your MySQL connection id is 7  

Server version: 5.1.73 Source distribution  

  Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.  

  Oracle is a registered trademark of Oracle Corporation and/or its  

affiliates. Other names may be trademarks of their respective  

owners.  

  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  

  mysql> 密码正确,就可以登录了.  

问题5:

C compiler on this system is: cc 

Cannot find appropriate C++ compiler onthis system.

configure: error: no acceptable C compilerfound in $PATH

解决5

apt-get install gcc build-essential  

问题6:

configure: error: no acceptable m4 could be found in $PATH.

解决6

ftp://ftp.gnu.org/gnu/m4/  

apt-get install m4  

问题7:

make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
ubuntu version: Ubuntu 14.04 LTS

解决7:

1:要么磁盘存储空间不足,一版5.6的大概30G左右!

2:安装:

apt-get install bison  

问题8:

make && make install

The program 'make' is currently not installed. You caninstall it by typing:

解决8:

apt-get install make  

问题9:

mysql启动失败!

root@server:/usr/local/mysql/support-files# ./mysql.server  start

Starting MySQL

... * Theserver quit without updating PID file (/data/mysql.pid).

解决9:

1:my.cnf配置文件配置错误!参考

2:安装完后,可能重启下系统,可选建议!

3:mysql源码编译问题!