phpmyadmin登入報錯外加linux下修改mysql登入密碼

來源:互聯網
上載者:User

標籤:phpmyadmin1130報錯   mysql修改密碼   

1.centos6.5中修改mysql的登入密碼。

  

[[email protected] ~]# mysql -u root -p

Enter password: 

ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

 

報錯資訊,

解決辦法:

[[email protected] ~]# /etc/init.d/mysqld stop

停止 mysqld:                                              [確定]

[[email protected] ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 

[[email protected] ~]# mysql -u root mysql 

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


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

Your MySQL connection id is 1

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.

現在開始修改密碼     紅色是新的密碼 預設是在root賬戶下修改色是新的密碼 預設是在root賬戶下修改

mysql> UPDATE user SET Password=PASSWORD(‘77066188‘) where USER=‘root‘;

Query OK, 3 rows affected (0.00 sec)

Rows matched: 3  Changed: 3  Warnings: 0


mysql> FLUSH PRIVILEGES; 

Query OK, 0 rows affected (0.00 sec)


mysql> quit

下面要做的事重啟mysql

[email protected] ~]# /etc/init.d/mysqld restart

141105 16:47:10 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

停止 mysqld:                                              [確定]

正在啟動 mysqld:                                          [確定]

[1]+  Done                    mysqld_safe --user=mysql --skip-grant-tables --skip-networking

重新登入mysql

[[email protected] ~]# mysql -u root -p

Enter password: 

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

Your MySQL connection id is 2

Server version: 5.1.73 Source distribution


在紅色輸入剛剛你修改的密碼。就可以進來mysql

    2.無法登入phpmyadmin,報1130錯誤

centos安裝配置好phpmyadmin web登入phpmyadmin介面報錯

   1.解決方案,

[[email protected] ~]# mysql -u root -p

Enter password: 

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

Your MySQL connection id is 4

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> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A


Database changed

mysql> select ‘host‘ from user where user=‘root‘;

+------+

| host |

+------+

| host |

| host |

| host |

+------+

3 rows in set (0.00 sec)

使用授權的方法,授予使用者遠端存取的許可權

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘mypassword‘ WITH GRANT OPTION;

mysql> select user,host from user;

+------+-----------+

| user | host      |

+------+-----------+

| root | %         |

| root | 127.0.0.1 |

|      | cmstest   |

| root | cmstest   |

|      | localhost |

+------+-----------+

5 rows in set (0.00 sec)


mysql> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘77066188‘ with grant option;

Query OK, 0 rows affected (0.00 sec)


mysql> select user,host from user;

+------+-----------+

| user | host      |

+------+-----------+

| root | %         |

| root | 127.0.0.1 |

|      | cmstest   |

| root | cmstest   |

|      | localhost |

+------+-----------+

5 rows in set (0.00 sec)


mysql> quit

Bye

下面是相關命令

 582  /etc/init.d/mysqld stop 

  583  mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 

  584  mysql -u root mysql 

  585  /etc/init.d/mysqld restart

  586  mysql -u root -p

  587   /etc/init.d/mysql stop 

  588  /etc/init.d/mysqld stop

  589  mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 

  590  mysql -u root mysql 

  591  /etc/init.d/mysqld restart

  592  mysql -u root -p

  593  /etc/init.d/mysqld restart

  594  [[email protected] ~]# /etc/init.d/mysqld stop

  595  停止 mysqld:


退出MySQL之後重啟再轉會phpmyadmin登入介面。現在你可以登入試試看啦。


650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />650) this.width=650;" src="/e/u261/themes/default/images/spacer.gif" style="background:url("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd;" alt="spacer.gif" />



phpmyadmin登入報錯外加linux下修改mysql登入密碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.