انجمن‌های فارسی اوبونتو

کمک و پشتیبانی => برنامه‌سازی => نویسنده: یاسین! در 19 اردیبهشت 1393، 02:16 ب‌ظ

عنوان: مشکل در Mysql
ارسال شده توسط: یاسین! در 19 اردیبهشت 1393، 02:16 ب‌ظ
سلام.

من mysql رو برای نوشتن وب ریختم و وقت نصب یه پسوورد در نظر گرفتم.

الان که اینو
mysql -u root -p
میزنم و پسوورد رو میزنم اما میگه:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

خب این ارور سرچ کردم و این سایت رو دیدم:
https://help.ubuntu.com/community/MysqlPasswordReset
اون جا گفته که اینو بزن:

sudo /etc/init.d/mysql stop
و این ارورا رو تو نتیجه میده:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql


چیکارش کنم؟ اشکمو در آورده...  ](*,)

عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: کامروا در 19 اردیبهشت 1393، 03:03 ب‌ظ
سلام

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

این خطا یعنی داری پسورد اشتباه میزنی!

sudo /etc/init.d/mysql stopتوی متن خطا نوشته که بجای دستور بالایی باید این دستور رو بزنی‌:
sudo service mysql stopیا
sudo stop mysql
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: یاسین! در 19 اردیبهشت 1393، 03:53 ب‌ظ

توی متن خطا نوشته که بجای دستور بالایی باید این دستور رو بزنی‌:
sudo service mysql stopیا
sudo stop mysql

خب وارد محیط mysql شدم. طبق این آموزش پسوردو ریست کردم:

    start the mysql client process using this command

           mysql -u root

    from the mysql prompt execute this command to be able to change any password

           FLUSH PRIVILEGES;

    Then reset/update your password

           SET PASSWORD FOR root@'localhost' = PASSWORD('password');

    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';

    Alternate Method:

           USE mysql
           UPDATE user SET Password = PASSWORD('newpwd')
           WHERE Host = 'localhost' AND User = 'root';

    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;

Then stop the mysqld process and relaunch it with the classical way:

sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start

(از سایت ubuntu.com)

با وجود ریست کردن بازم همون ارور قبل!



و من همچنان:
 ???
 ](*,)
 :'(
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: کامروا در 19 اردیبهشت 1393، 04:39 ب‌ظ
بعد از اینکه MySQL رو Stop کردی،

۱- این دستور رو اجرا کن :
$ sudo mysqld_safe --skip-grant-tables &۲- بعد :
$ sudo mysql -u root mysql۳- حالا باید پسورد رو تغییر بدی :
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; flush privileges; exit;

۴-بعد سرویس MySQL رو restart کن.
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: یاسین! در 19 اردیبهشت 1393، 04:50 ب‌ظ
،
۱- این دستور رو اجرا کن :
$ sudo mysqld_safe --skip-grant-tables &۲- بعد :
$ sudo mysql -u root mysql
به $ اول دستورات ایراد میگیره. بدون اونا هم تو مرحله ۲ باز

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

 ???
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: کامروا در 19 اردیبهشت 1393، 04:57 ب‌ظ
$ اول دستورات یعنی در وضعیت غیر مدیر باشی! (نباید تایپ کنی)
MySQL رو Stop کن بعدش خروجی دستور زیر رو اینجا بذار :
$ sudo mysqld_safe --skip-grant-tables &
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: یاسین! در 19 اردیبهشت 1393، 05:02 ب‌ظ
$ اول دستورات یعنی در وضعیت غیر مدیر باشی! (نباید تایپ کنی)
MySQL رو Stop کن بعدش خروجی دستور زیر رو اینجا بذار :
$ sudo mysqld_safe --skip-grant-tables &
[1] 5506
yasin@yasin-System-Product-Name:~$ 140509 16:48:04 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
140509 16:48:04 mysqld_safe Logging to '/var/log/mysql/error.log'.
140509 16:48:04 mysqld_safe A mysqld process already exists
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: کامروا در 19 اردیبهشت 1393، 05:07 ب‌ظ
نقل‌قول
[1] 5506
yasin@yasin-System-Product-Name:~$ 140509 16:48:04 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
140509 16:48:04 mysqld_safe Logging to '/var/log/mysql/error.log'.
140509 16:48:04 mysqld_safe A mysqld process already exists

خب MySQL هنوز اجرا هست. واسه همین به حالت Safemode نمیره!

اینبار MySQL رو اینجور Stop کن :
$ sudo killall mysqld بعدش دوباره دستور زیر اجرا کن و خروجی قرار بده :
$ sudo mysqld_safe --skip-grant-tables &
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: یاسین! در 19 اردیبهشت 1393، 05:10 ب‌ظ
نقل‌قول
[1] 5506
yasin@yasin-System-Product-Name:~$ 140509 16:48:04 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
140509 16:48:04 mysqld_safe Logging to '/var/log/mysql/error.log'.
140509 16:48:04 mysqld_safe A mysqld process already exists

خب MySQL هنوز اجرا هست. واسه همین به حالت Safemode نمیره!

اینبار MySQL رو اینجور Stop کن :
$ sudo killall mysqld بعدش دوباره دستور زیر اجرا کن و خروجی قرار بده :
sudo mysqld_safe --skip-grant-tables &
[1] 6037
yasin@yasin-System-Product-Name:~$ 140509 17:09:48 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
140509 17:09:48 mysqld_safe Logging to '/var/log/mysql/error.log'.
140509 17:09:48 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: کامروا در 19 اردیبهشت 1393، 05:14 ب‌ظ
خوبه. الان MySQL اجرا نیست و با موفقیت به حالت Safemode رفتی...
حالا مرحله ۲ به بعد رو انجام بده(پست شماره #3) (http://forum.ubuntu.ir/index.php/topic,90917.msg747727.html#msg747727).
عنوان: پاسخ : مشکل در Mysql
ارسال شده توسط: یاسین! در 19 اردیبهشت 1393، 05:24 ب‌ظ
بالاخره درست شد!


امیدوارم همیشه موفق باشی عزیز!  ;)