LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-31-2006, 08:27 AM   #1
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Rep: Reputation: 30
mysql root password


I'm a begginner in mysql .I'm trying to password it and this is what i was doing:
Quote:
mysql> UPDATE user SET Password = password('p4ssw0rd')WHERE User = ('root');
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> quit
Bye
root@mail:~# mysql -u root -p ga8r13l3
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
root@mail:~# mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
What is the correct way ???
Thanks !!!!

Last edited by gabsik; 05-31-2006 at 08:29 AM.
 
Old 05-31-2006, 08:36 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't think you want parentheses around root - ie

UPDATE user SET Password=PASSWORD('passwd') WHERE User='root';

ps gabsik - why are you and I always on the same threads?

Last edited by billymayday; 05-31-2006 at 08:44 AM.
 
Old 05-31-2006, 08:49 AM   #3
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Mysql is not a networking issue ?
I don't understand your question ... thanks anyway !!!!

Last edited by gabsik; 05-31-2006 at 09:19 AM.
 
Old 05-31-2006, 08:53 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I don't get your first line - what's networking got to do with it?

On the second point, I was refering to you port redirection issue, and I noticed we were both answering something else
 
Old 05-31-2006, 09:18 AM   #5
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Missunderstandings do happen , pardon !
Mysql allows access with no password:
Quote:
root@mail:~# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 4.0.24_Debian-10sarge1-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye
root@mail:~# mysql -u root -p
Enter password:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
... denyes when i enter the one i previously succesfully set !

Quote:
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> UPDATE user SET Password=PASSWORD('password')WHERE User='root';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0

Last edited by gabsik; 05-31-2006 at 09:24 AM.
 
Old 05-31-2006, 09:29 AM   #6
gbell72
Member
 
Registered: Sep 2003
Location: Toronto, Canada
Distribution: FreeBSD
Posts: 78

Rep: Reputation: 15
From the reference manual the correct way to set your passwords are

Code:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd');
If you forgot your password shutdown mysqld then run
Code:
mysqld_safe --skip-grant-tables &
You should now be able to login without a password. In the MySQL command line prompt type the following to update your passwords.
Code:
mysql> UPDATE user SET password=PASSWORD('newpass') WHERE user="root" AND hostname="localhost";
mysql> FLUSH PRIVILEGES;
You can also use the mysqladmin command mysqladmin -h hostname -u user password 'new password'
 
Old 06-03-2006, 10:58 AM   #7
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Thanks !!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql root password lost nazir Linux - Software 6 10-09-2007 10:18 AM
MySQL root password. bulzbb Linux - Newbie 2 03-11-2004 09:32 AM
Resetting MySQL root password b200306 Linux - Software 3 02-08-2004 03:21 PM
Mysql root password spintrance7 Linux - Software 7 11-29-2003 04:20 PM
MYSQL root password forgotton jon_k Linux - Software 5 07-18-2003 08:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration