Ubuntu18.04:mysql:ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘
Ubuntu安裝mysql:
sudo apt-get update
sudo apt-get install mysql-server
登入時遇到報錯:
mysql -u root -p
解決方法:
輸入sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
進入mysql配置檔案:
在skip-external-locking後面加上skip-grant-tables,儲存,退出。
終端執行 service mysql restart
,重新啟動mysql。
終端執行mysql -u root -p
,提示輸入密碼直接回車即可,進入mysql後,分別執行下面三句:
use mysql;
update user set authentication_string=PASSWORD('新密碼') where user='root';
flush privileges;
然後輸入quit
,退出mysql。
重新進入到mysqld.cnf檔案,sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf,
把剛開始加的skip-grant-tables這條語句給註釋掉。
再返回終端輸入mysql -u root -p
,輸入剛設定的密碼,就可以了。
相關文章
- MySQL使用普通使用者訪問返回ERROR 1698 (28000): Access denied for user 'root'@'localhost'MySqlErrorlocalhost
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:YES)Errorlocalhost
- 報錯”ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)”Errorlocalhost
- 解決Mysql:ERROR 1045 (28000):Access denied for user ‘root‘@‘localhost‘ (using password: NO)的方法MySqlErrorlocalhost
- MySQL 8.0.13 密碼問題 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)MySql密碼Errorlocalhost
- Linux錯誤 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)LinuxErrorlocalhost
- ubuntu mysql Access denied for user root@localhostUbuntuMySqllocalhost
- mysql 1045, "Access denied for user 'root'@'localhost' (using password: NO)"MySqllocalhost
- vue專案中連線MySQL時,報錯ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password:YES)VueMySqlErrorlocalhost
- Access denied for user ‘root‘@‘localhost‘問題的解決localhost
- 啟動報錯:Access denied for user 'root'@'localhost' (using password:YES)localhost
- java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘ (using password: YES)JavaSQLExceptionlocalhost
- MySQL系列:Docker安裝 MySQL提示錯誤:Access denied for user'root'@'localhost' (using password:yes)MySqlDockerlocalhost
- SpringBoot中yml配置java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘ (using password: NOSpring BootJavaSQLExceptionlocalhost
- mac os x 安裝mysql遇到 Access denied for user ‘root‘@‘localhost‘ (using password: YES)的解決方法MacMySqllocalhost
- Navicat遠端連線MySQL 提示1045 - Access denied for user 'root'@'223.74.158.192'(using password:YES)MySql
- SQLSTATE[HY000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: YES)”錯誤的隱藏解決辦法SQLlocalhost
- Permission denied:user=xxx,access=WRITE,inode=xxx
- Access denied for user 'default'@'%' to database 'shop'報錯Database
- 【本人親測 已解決】044 - Access denied for user ‘root‘@‘%‘ to database ‘資料庫名稱‘Database資料庫
- laravel mysql批量提交報Access denied 錯誤LaravelMySql
- Caused by: java.sql.SQLException: Access denied for user 'dell-pc'@'xxxxx' (using password: YES)JavaSQLException
- hive建立分割槽表報錯AccessControlException Permission denied: user=NONE, access=WRITE, inodeHiveExceptionNone
- ERROR 1045 (28000): ProxySQL Error: 報錯ErrorSQL
- mybatis進行資料庫建表 CREATE command denied to user 'root'@'127.0.0.1' for table 問題MyBatis資料庫127.0.0.1
- load data infile ERROR 1045 (28000)Error
- nginx中報Access denied.Nginx
- mysql登入報錯提示:ERROR 1045 (28000)的解決方法MySqlError
- Mysql資料庫報ERROR 1045 (28000)報錯及MySQL忘記密碼找回MySql資料庫Error密碼
- Docker + maven build problem — unix://localhost:80: Permission deniedDockerMavenUIlocalhost
- OGG Director連線報錯Access denied
- Error: Permission denied @ apply2filesErrorAPP
- Ubuntu git pull 出現Permission denied ErrorUbuntuGitError
- Error: User gpmon is not allowed to login Command CenterError
- Django Error: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissionsDjangoErrorORB
- [20201120]pam_systemd(crondsession) Failed to create session Access denied.txtSessionAI
- 網站程式呼叫資料庫時提示“command denied to user”網站資料庫
- MySQL 5.7 建立使用者報錯 ERROR 1805 (HY000): Column count of mysql.user is wrongMySqlError