LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-15-2004, 09:19 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,121

Rep: Reputation: 46
mysql problems


First, I decided to set a password by reading the documentation. So I set it to 1234. Now it won't let me use mysql anymore, it won't accept that password.

I type mysql -u root 1234 and I get access denied. I tried mysql -u root -p 1234 then it asks for a password, so I put that, access denied again. Why is it doing this?

Another problem, I installed phpmyadmin, but when I open it I get this error:

Fatal error: Call to undefined function: mysql_get_client_info() in /var/www/html/phpmyadmin/libraries/defines.lib.php on line 47


Why? I'm running php 4.2.2 and phpmyadmin requires php 4.1.something.

I'm not sure what version of mysql I'm running because of the first problem, it won't let me do the mysql -v command. It just says access denied.

Thanks in advance.
 
Old 02-15-2004, 10:34 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
MySQL syntax is kind of goofy. If I remember correctly, you can't have a space between the -p flag and the password. So the line might be:

mysql -u root -p1234

You can also use mysql -u root -p and then mysql will prompt you for the password.

Of course, be sure that mysqld is running
 
Old 02-16-2004, 05:50 PM   #3
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,121

Original Poster
Rep: Reputation: 46
That sort of works, but even now that I'm logged in, it won't let me do anything. It keeps saying access denied.

mysql> \u mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
mysql>
 
Old 02-16-2004, 07:59 PM   #4
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
It sounds like you haven't granted privileges to the user. You probably want to have a bit of a read here at MySQL
 
Old 02-16-2004, 11:25 PM   #5
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,121

Original Poster
Rep: Reputation: 46
Tried all of that, still not working. Here's a typical session:










[root@borg root]# mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
[root@borg root]# mysql -uroot-p1234
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 3.23.52

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

mysql> select * from mysql;
ERROR 1046: No Database Selected
mysql> \u mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'
mysql> set password for root = password("");
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'


Even once I log in, it's still complaining that I don't have permission, that's what I don't get. If I did mysql -uroot-p1234 the first time, why does it not get the point that I logged in and let me do what I need?

Also, I installed phpmyadmin, but when I open it I get this error:


Fatal error: Call to undefined function: mysql_get_client_info() in /var/www/html/phpmyadmin/libraries/defines.lib.php on line 47


Why is it using functions that don't exist? Do I need to install some kind of library or something?
 
Old 02-17-2004, 10:30 AM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 416Reputation: 416Reputation: 416Reputation: 416Reputation: 416
Hm. OK, did you install from an rpm or did you install from source? If you installed from rpm, the various set-up scripts should have been run for you, but if you installed from source, you need to run the scripts (see the install documentation for details). Those scripts set up the initial root permissions. The MySQL site has a section on access denied errors and I'd be real tempted to run through some of the tests their. If this doesn't clear up, you could also run mysqld with the --skip-grant-tables flag. That should give root complete access to the databases.

Finally, I'm not familiar with the /u syntax. Does plain old use mysql work?
 
Old 02-17-2004, 02:17 PM   #7
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Have just started using mysql myself. Noticed it gets excited about the name of the computer; after all it's a server/client thing.

Perhaps look in /etc/hosts is it?

Perhaps start with:
mysql -u <username> -h <hostname> whatever

or something.

MySQL's 'root' is not the same as 'root' the superuser.
 
Old 02-17-2004, 05:24 PM   #8
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 17.1 KDE on workstation, CentOS 6.x on servers
Posts: 1,121

Original Poster
Rep: Reputation: 46
I did not install it, it's the same one that comes with red hat. the /u is to use the database, I have not tried use, I guess it's the same thing. I just typed help and it said /u. I'll try the --skip-grant-tables thing and see what happens.
 
Old 02-17-2004, 06:19 PM   #9
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally posted by Red Squirrel
I did not install it, it's the same one that comes with red hat. the /u is to use the database, I have not tried use, I guess it's the same thing. I just typed help and it said /u. I'll try the --skip-grant-tables thing and see what happens.
To switch databases, use the 'use' command:

mysql> use <database-name>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-08-2008 12:48 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM
DBD::MySQL + MySQL install problems. Elleroth Linux - Software 4 03-24-2006 07:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:14 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration