By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

login as user 'root' but do not have root privlages and mysql doesn't recognize root logged in

P: n/a
Hi gang:
I'm experiencing a problem with MySQL -- I updated MySQL from version 4.1.0
to 4.1.10 and now when I login as root it doesn't show all the databases I
should have access to, nor it doesn't recognize me being logged in as root
(via CURRENT_USER().)

Here it is, line-by-line. Inline comments are denoted by '//'

err# uname -a
FreeBSD err.the_hostname.net 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11
04:21:45 GMT 2004 ro**@wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC
i386

// FreeBSD 5.2 -- MySQL was deinstalled and upgraded via the ports
collection.

err# mysql --version
mysql Ver 14.7 Distrib 4.1.10, for portbld-freebsd5.2 (i386)

// Mysql version 4.1.10

err# ps auxwww |grep mysql
mysql 42951 0.0 0.2 924 400 p0 I 7:46PM 0:00.01 /bin/sh
/usr/local/bin/mysqld_safe --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/err.the_hostname.net.pid
mysql 42968 0.0 9.9 52968 23556 p0 S 7:46PM 0:08.07
/usr/local/libexec/mysqld --basedir=/usr/local --datadir=/var/db/mysql --pid-file=/var/db/mysql/err.the_hostname.net.pid

// MySQL is running as the user 'mysql' and loads the datadir
'/var/db/mysql'

err# ls -la /var/db/mysql/
total 28782
drwx------ 7 mysql mysql 512 Feb 22 19:47 .
drwxr-xr-x 8 root wheel 512 Feb 18 16:59 ..
-rw-rw---- 1 mysql mysql 8224 Feb 22 14:35 err.err
-rw-rw---- 1 mysql mysql 8292 Feb 22 19:47 err.the_hostname.net.err
-rw-rw---- 1 mysql mysql 6 Feb 22 19:46 err.the_hostname.net.pid
-rw-rw---- 1 mysql mysql 25088 May 16 2004 ib_arch_log_0000000000
-rw-rw---- 1 mysql mysql 5242880 Feb 22 19:46 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 May 16 2004 ib_logfile1
-rw-rw---- 1 mysql mysql 18874368 Feb 22 18:55 ibdata1
drwx------ 2 mysql mysql 1024 Nov 18 17:54 jaga
drwx------ 2 mysql mysql 1024 May 16 2004 mysql
drwx------ 2 mysql mysql 512 Jun 8 2004 projects
drwx------ 2 mysql mysql 512 May 16 2004 tempdb
drwx------ 2 mysql mysql 512 Jun 3 2004 test

// The user 'mysql' owns /var/db/mysql and the contents within. This is the
data directory for MySQL.

err# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 4.1.10

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

// I login as the user 'root'

mysql> show databases;
+----------+
| Database |
+----------+
| test |
+----------+
1 row in set (0.00 sec)

// None of the databases in /var/db/mysql (except 'test') show.

mysql> SHOW VARIABLES LIKE "datadir";
+---------------+----------------+
| Variable_name | Value |
+---------------+----------------+
| datadir | /var/db/mysql/ |
+---------------+----------------+
1 row in set (0.00 sec)

// The path is as expected.

mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| @localhost |
+----------------+
1 row in set (0.00 sec)

// I login as 'root' but it shows the current user as "@localhost" ?

Something isn't right. Any ideas?
Thanks,
Jul 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.