English 中文(简体)
MySQL:在升级至5.5后,我不能把自己作为根基。
原标题:MySQL: I cannot login as root after upgrading to 5.5
  • 时间:2011-10-28 11:35:23
  •  标签:
  • mysql
  • mysql5

http://www.ovaistariq.net/490/a-pan-by-pan-guide-to-upgrad-to-mysql-5/“rel=“nofollow”>tutorial,升级为我的sql.5。

在完成所有步骤之后,我填写了<代码> 我sql-ugen-pXXXX。

Error 1045 (28000): Access denied for user  root @ localhost  (using password: YES).

辅导员在一段时间前为我工作,但现在我有这个问题。 我把布图+mysql 5.1重新插入,我没有问题做“Msql -u fundamental -pXXXX”,但在升级到5.5之后,我再次发现上述错误。

这是我的/etc/my.cnf:

# The following options will be passed to all MySQL clients
[client]
#password    = your_password
port        = 3306
socket        = /var/run/mysqld/mysqld.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
user            = mysql
socket        = /var/run/mysqld/mysqld.sock
port        = 3306
basedir         = /usr/local/mysql
datadir         = /usr/local/mysql/data
tmpdir          = /tmp
log_error       = /var/log/mysql/error.log
skip-external-locking
...

任何想法?

http://www.ohchr.org。 我也应当支持用户群,因为I m在升级到5.5之前拆除数据库。

关于

Javi

最佳回答

只是说,你重新使用错误的密码......

尽管我不知道为什么(也许更新者夸大了它吗?),但你是否必须重新确定根本密码。

  1. make sure there are no mysqld deamons running.
  2. get to your mysql/bin directory
  3. start a mysql deamon with mysqld_safe --skip-grant-tables (note the PID)
  4. start command line mysql: mysql
  5. execute this little script with your edit:

[code] use mysql; UPDATE user SET Password=PASSWORD( YOUR_NEW_PASSWORD_HERE ) WHERE User = root ; exit; [/code]

Now you re only need to kill your mysqld_safe (remember the PID?..) and start the deamon normally.

问题回答

乌班图18.04,作为根基用户:

# service mysql stop
# mkdir /etc/run/mysql && chown -R mysql:mysql /etc/run/mysql
# mysqld_safe --skip-grant-tables --user=mysql &

这将在不验证根基使用者的情况下启动。 然后,在另一个终端/小时窗口中,你可以开始使用我的客户,改变用户密码:

# mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> use mysql;
mysql> UPDATE user SET authentication_string = PASSWORD( NeWPaSSWoRD ) WHERE User =  root ;
mysql> FLUSH PRIVILEGES;
mysql> exit;

Then, stop the mysqld_safe process in the first terminal. Replace the "processid" below with the contents of /var/run/mysqld/mysqld.pin.

# kill -9 "processid"

开始神话,再次尝试伐木。

# service mysql start
# 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.7.26-0ubuntu0.18.04.1-log (Ubuntu)
mysql>

Save the yourself of a MAJOR Headache... 您的问题可能是,你没有在密码上引述。 尤其因为你实际上能够穿过——笔开,而不是使用你的礼仪。

[client]
user = myusername
password = "mypassword"
host = localhost

rel=“nofollow”http://dev.mysql.com/doc/refman/5.5/en/option-files.html

RE: CENTOS

Make sure you have set mysql to auto-start on boot:

页: 1

如果不是的话,则添加我的面纱,以开始书写:

chkconfig www.un.org/Depts/DGACM/index_chinese.htm

...

如果这还不奏效,我就这样做了:

页: 1

我sqld_safe -skip-grant-tables &

mysql -u root

a. 我sql>

我sql>, 更新用户密码=PASSWORD(“新密码”),用户在其中扎根;

mysql> flush privileges;

我sql>quit

页: 1

/etc/init.d/mysqld开端





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签