? ? ? ?一直以來(lái)我都比較喜歡使用Linux當(dāng)中的yum來(lái)安裝,Mysql數(shù)據(jù)庫(kù)的第一個(gè)版本就是發(fā)行在Linux系統(tǒng)上的。下面是我參照別人的方法來(lái)安裝的(http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html),卻在設(shè)置root密碼的時(shí)候報(bào)錯(cuò)了。
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)
windows中mysql報(bào)錯(cuò)處理方法https://jingyan.baidu.com/article/3ea51489e6cfbe52e61bba25.html
數(shù)據(jù)庫(kù)初始密碼為new-password
當(dāng)我把mysql設(shè)置成開(kāi)機(jī)自啟動(dòng)后

接著輸入mysqladmin -u root password?'root'

然后提示:Access denied for user 'root'@'localhost' (using password: NO)
用戶(hù)訪(fǎng)問(wèn)被拒絕的根'@'本地主機(jī)'(使用密碼:無(wú))
然后使用Mysql 忘記root密碼解決方案skip-grant-tables解決了
操作方法:
1、殺掉原來(lái)進(jìn)行著的mysql:
rcmysqld stop
或者:
service mysqld stop
或者:
kill -TERM mysqld
2、Vim /etc/my.cnf
加入skip-grant-tables
以命令行參數(shù)啟動(dòng)mysql:
/usr/bin/mysqld_safe --skip-grant-tables &
3、修改管理員密碼:新開(kāi)窗口
mysql -u root -p ?后不輸入密碼直接回車(chē)
use mysql;
update user set password=password("123456") where user="root";
flush privileges;
exit;
4、把my.cnf中的skip-grant-tables去掉,重啟服務(wù)

數(shù)據(jù)庫(kù)就可以登錄進(jìn)去了。