English 中文(简体)
我怎么能够把MySQL的口号放在“Mesqld_safe”的设想中?
原标题:How can I set the MySQL’s password in the “mysqld_safe” is running scenario?
  • 时间:2018-10-18 04:27:02
  •  标签:
  • mysql
  • macos

我使用低调指挥器,发现可运行的<条码>mysql。 服务:

$ps -ef | grep mysqld
  501  4512     1   0 12:19 pm ??         0:00.06 /bin/sh /Applications/MAMP/Library/bin/mysqld_safe --port=8889 --socket=/Applications/MAMP/tmp/mysql/mysql.sock --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --log-error=/Applications/MAMP/logs/mysql_error_log
  501  4849  4512   0 12:19 pm ??         0:00.29 /Applications/MAMP/Library/bin/mysqld --basedir=/Applications/MAMP/Library --datadir=/Applications/MAMP/db/mysql56 --plugin-dir=/Applications/MAMP/Library/lib/plugin --log-error=/Applications/MAMP/logs/mysql_error_log.err --pid-file=/Applications/MAMP/tmp/mysql/mysql.pid --socket=/Applications/MAMP/tmp/mysql/mysql.sock --port=8889

但是,我忘记了这些口号,或者也许我没有提出过。

我怎么能写我的我的我的我的我的我的我的我的我的我的我的我的我的我的我的我的我的我的我的口号?

以及<代码>mysqld_safe 服务运行意味着密码没有确定?

最佳回答
  1. Stop the MySQL demon process using this command :
    sudo /etc/init.d/mysql stop
    
  2. Start the mysqld daemon process using the --skip-grant-tables option with this command:
    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
    
  3. Start the MySQL client process using this command:
    mysql -u root
    
  4. From the MySQL prompt execute this command to be able to change any password
    FLUSH PRIVILEGES;
    
  5. Then reset/update your password
    SET PASSWORD FOR root@ localhost  = PASSWORD( password );
    
  6. If you have a MySQL root account that can connect from everywhere, you should also do:
    UPDATE mysql.user SET Password=PASSWORD( newpwd ) WHERE User= root ;
    
  7. Alternate Method:
    USE mysql
       UPDATE user SET Password = PASSWORD( newpwd )
       WHERE Host =  localhost  AND User =  root ;
    
  8. And if you have a root account that can access from everywhere:
    USE mysql
       UPDATE user SET Password = PASSWORD( newpwd )
       WHERE Host =  %  AND User =  root ;
    
    For either method, once have received a message indicating a successful query (one or more rows affected), flush privileges:
    FLUSH PRIVILEGES;
    
  9. Then stop the mysqld process and relaunch it with the classical way:
    sudo /etc/init.d/mysql stop
    sudo /etc/init.d/mysql start
    
问题回答

暂无回答




相关问题
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 ...

热门标签