Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-15-2003, 04:36 PM
|
#1
|
Member
Registered: Feb 2003
Posts: 35
Rep:
|
mysql help
[root@ns bin]# ./mysqldump -u root -p dcb
Enter password:
./mysqldump: Got error: 1045: Access denied for user: 'root@localhost' (Using password: YES) when trying to connect
[root@ns bin]#
I can't figure out what my root is for mysql I used to could backup mysql databases and I can't figure out any root to get it to work any idea of how I can recover a root pass?
|
|
|
02-15-2003, 05:25 PM
|
#2
|
Senior Member
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131
Rep:
|
werd'
OK:
first you need to kill mySQL.
I'm not a ensim guy so, I can only tell you how I would do it under linux. Your going to have to fill in the blanks for ensim specific commands;
shell> kill `cat /mysql-data-directory/hostname.pid';
#this kills the mysql process id
#You must be either the Unix root user or the same user mysqld runs as to do this
#Restart mysqld with the --skip-grant-tables option.
shell> /path/to/mysql/mysql --skip-grant-tables;
#this will start mysql but the process will be in the shell not in the background so you will need another shell to login to the process you started.
another shell> mysql -u root
# at this this point you should be in the mysql shell
mysql> use mysql;
mysql> UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root';
mysql> FLUSH PRIVILEGES;
#All done;
Now go to the other shell and hold cntrl down and hit "c" a couple times fast.
Then start mysql the "normal way" and use root to create a user for each database you need for each project!
Example:
login to mysql
create a database called "project1"
mysql> create database project1;
mysql> GRANT ALL PRIVILEGES ON project1.* TO projectuser@localhost IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
This way only projectuser can access the project1 database, this is better for security. You don't want all projects connecting as root!!
|
|
|
02-15-2003, 05:42 PM
|
#3
|
Member
Registered: Feb 2003
Posts: 35
Original Poster
Rep:
|
but I don't use ensim this specific box is a plesk box.
|
|
|
02-17-2003, 08:12 PM
|
#4
|
Member
Registered: Feb 2003
Posts: 35
Original Poster
Rep:
|
ttt
|
|
|
02-17-2003, 08:21 PM
|
#5
|
Senior Member
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131
Rep:
|
Quote:
Originally posted by Zac2003
but I don't use ensim this specific box is a plesk box.
|
What ever I use plesk. Same difference. You just have to use "/usr/local/psa/mysql/bin/mysql/" as the paths and by default plesk install the root user is in some cases gone and it's "admin".
Mz
|
|
|
02-17-2003, 09:00 PM
|
#6
|
Member
Registered: Feb 2003
Posts: 35
Original Poster
Rep:
|
oh sweet just changed root to admin w00t w00t and it worked thx guys 
|
|
|
02-17-2003, 09:09 PM
|
#7
|
Senior Member
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131
Rep:
|
your velcome
|
|
|
08-15-2003, 11:18 AM
|
#8
|
Member
Registered: Oct 2002
Location: Malaysia
Posts: 106
Rep:
|
Hi guys,
When I type mysql on the shell as root , I am getting the above error "1045: Access denied for user: 'root@localhost' (Using password: YES) "
I have tried the above steps by restarting the mysql with the --skip-grant-tables access :
root@abc [/var/lib/mysql/mysql]# /etc/rc.d/init.d/mysql start --skip-grant-tables;
root@abc [/var/lib/mysql/mysql]# mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
I have checked the /.my.cnf file and the file is on the root folder.
Any advice will be appreciate .
|
|
|
08-16-2003, 07:34 PM
|
#9
|
Senior Member
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131
Rep:
|
HUM'
Well I'm not sure about using init.d for sending flag such as --skip-grant-tables; Does this really work?
I think you have to kill the proess init.d creates and then start the mysql server from a root shell. Reset the pass and then kill that shell and start again via init.d.
And if your stiil getting this error for root make sure you have a root user in mySQL! Is this the default install?
Micxz
|
|
|
08-17-2003, 05:00 PM
|
#10
|
Member
Registered: Oct 2002
Location: Malaysia
Posts: 106
Rep:
|
Hi,
Found the cause of the problem !We have included "Special Character ( &%#@ ) "in our MYSQL root password and this had caused the problem . We reset the password without any Special character and it resolved the issue. Thank God !
Steps :
Make sure root pass is in /root/.my.cnf
This is usually the first root pass the box was given once cpanel is installed.
If it still does not work, you will need to reset the mysqld root pass.
First, stop the mysqld, usually /etc/rc.d/init.d/mysql stop
Then stop chkservd to keep it from interfering with mysqld while you work on it with /etc/rc.d/init.d/chkservd stop
Start up mysqld , but, without the grant tables,
mysqld --skip-grant-tables -u mysql &
Then change the pass..
mysql -u root mysql UPDATE user SET Password=PASSWORD('new_password') WHERE user='root';
FLUSH PRIVILEGES;
Now you just killall -9 mysqld and start it up normally with it's safe_mysqld script..
and update your password in /root/.my.cnf
Remember NOT to include "Special Character" in the password !
Hope this help others !
|
|
|
08-17-2003, 10:47 PM
|
#11
|
Senior Member
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131
Rep:
|
I wouldn't leave that pass in there just for security reasons. But that's me.
|
|
|
All times are GMT -5. The time now is 08:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|