New mysql created in virtualmin are not visible on mysql commandline and visa-versa

This is a GPL version of virtualmin.

MySQL databases created in VM are visible inside VM but are not visible on command line mysql as root user. DBs created on command line as mysql user are not visible in VM. Trying to setup an app but keep getting "cannot connect to db" errors - I'm wondering if the db actually exists since I can't see it on the command line after creating in VM.

Any insight?

Thanks!
-- Craig

Status: 
Active

Comments

Are you sure Webmin/Virtualmin isn't configured to connect to MySQL on a remote system?

This cat be set at Webmin -> Servers -> MySQL Database -> Module Config.

I don't think so... See attached screenshot.

That looks OK. So can you see the new DB in that MySQL Databases module?

If so, what command are you using to show databases from the command line?

From root, enter mysql command prompt. Type "show databases;" and the DBs created in vm do not show.

But they do show up in the "MySQL Databases" list on the same machine?

I'm not sure what you mean. They show in VM but do not show from command line.

Are you by any chance running two MySQL instances on the same system?

Or does the root user's /root/.my.cnf file have an entry that causes MySQL client commands to connect to a different system?

No, I am not running multiple instances of mysql.

Here's everything in the root directory, no my.cnf file.

[root@nfatca ~]# ll -a
total 1088
dr-xr-x---  6 root root   4096 Jul 29 00:26 .
drwxr-xr-x 21 root root   4096 Jul 29 12:19 ..
-rw-------  1 root root   5062 Jul 29 00:57 .bash_history
-rw-r--r--  1 root root     18 May 20  2009 .bash_logout
-rw-r--r--  1 root root    176 May 20  2009 .bash_profile
-rw-r--r--  1 root root    176 Sep 23  2004 .bashrc
-rw-r--r--  1 root root    100 Sep 23  2004 .cshrc
drwx------  2 root root   4096 Jul 29 11:34 .gnupg
-rwxr-xr-x  1 root root  45215 May 10  2012 install.sh
-rw-------  1 root root     38 Jul 29 00:09 .lesshst
drwx------  5 root root   4096 Mar 10  2013 Maildir
-rw-------  1 root root     59 Jul 29 00:26 .mysql_history
-rw-------  1 root root   1024 Mar 10  2013 .rnd
drwx------  2 root root   4096 Mar 10  2013 .spamassassin
drwx------  2 root root   4096 Aug  8  2013 .ssh
-rw-r--r--  1 root root    129 Dec  4  2004 .tcshrc
-rw-------  1 root root   8167 Jul 29 00:26 .viminfo
-rw-r--r--  1 root root     30 May  8  2013 .vimrc
-rw-r--r--  1 root root 979501 Mar 10  2013 virtualmin-install.log

Here's a list of all processes running on the server:

[root@nfatca ~]# ps -auxw
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2900   920 ?        Ss   Jul29   0:00 init
root         2  0.0  0.0      0     0 ?        S    Jul29   0:00 [kthreadd/305]
root         3  0.0  0.0      0     0 ?        S    Jul29   0:00 [khelper/305]
root       134  0.0  0.0   2464   264 ?        S<s  Jul29   0:00 /sbin/udevd -d
root       501  0.0  0.0  29832  1032 ?        Sl   Jul29   0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
named      514  0.0  0.0  41160  1332 ?        Ssl  Jul29   0:00 /usr/sbin/named -u named
root       529  0.0  0.0  20492  1572 ?        S    Jul29   0:05 /usr/sbin/snmpd -LS0-6d -Lf /dev/null -p /var/run/snmpd.pid
root       538  0.0  0.0   8940   596 ?        Ss   Jul29   0:00 /usr/sbin/sshd
root       545  0.0  0.0   3264   584 ?        Ss   Jul29   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
clam       555  0.0 11.6 264728 237932 ?       Ssl  Jul29   0:09 clamd
root       590  0.0  0.0   6268  1232 ?        S    Jul29   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/va
mysql      695  0.0  0.2 117408  4144 ?        Sl   Jul29   0:15 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.lo
root       718  0.0  0.0   2876   568 ?        Ss   Jul29   0:00 /usr/sbin/dovecot
dovecot    721  0.0  0.0   2740   796 ?        S    Jul29   0:00 dovecot/anvil
root       722  0.0  0.0   2736   796 ?        S    Jul29   0:00 dovecot/log
root       725  0.0  0.0   4676   884 ?        S    Jul29   0:00 dovecot/config
root       729  0.0  0.0   9140   300 ?        Ss   Jul29   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
root       731  0.0  0.0   9140    64 ?        S    Jul29   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
root       739  0.0  0.5  42824 10540 ?        Ss   Jul29   0:08 /usr/bin/spamd -d -c -m5 -H -r /var/run/spamd.pid
root       743  0.0  0.3  42824  7968 ?        S    Jul29   0:00 spamd child
root       744  0.0  0.3  42824  7936 ?        S    Jul29   0:00 spamd child
postgrey   753  0.0  0.1  16364  3216 ?        Ss   Jul29   0:00 /usr/sbin/postgrey -d --unix=/var/spool/postfix/postgrey/socket
root       828  0.0  0.0  12960  2028 ?        Ss   Jul29   0:00 /usr/libexec/postfix/master
nobody     835  0.0  0.0  15428   840 ?        Ss   Jul29   0:00 proftpd: (accepting connections)
postfix    843  0.0  0.1  13200  2128 ?        S    Jul29   0:00 qmgr -l -t fifo -u
root       844  0.0  0.5  43608 11652 ?        Ss   Jul29   0:01 /usr/sbin/httpd
apache     848  0.0  0.0  26748  1980 ?        S    Jul29   0:00 /usr/sbin/httpd
root       852  0.0  0.0   7176   776 ?        Ss   Jul29   0:00 crond
apache     860  0.0  0.2  43608  4280 ?        S    Jul29   0:00 /usr/sbin/httpd
mailman    861  0.0  0.2  16716  5496 ?        Ss   Jul29   0:00 /usr/bin/python /usr/lib/mailman/bin/mailmanctl -s -q start
mailman    863  0.0  0.3  16552  8004 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=ArchRunner:0:1 -s
mailman    864  0.0  0.3  16940  8064 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=BounceRunner:0:1 -s
mailman    865  0.0  0.3  16588  8000 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=CommandRunner:0:1 -s
mailman    866  0.0  0.3  16540  7992 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=IncomingRunner:0:1 -s
mailman    867  0.0  0.3  16868  8044 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=NewsRunner:0:1 -s
mailman    868  0.0  0.3  16872  8100 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=OutgoingRunner:0:1 -s
mailman    869  0.0  0.3  16612  8008 ?        S    Jul29   0:04 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=VirginRunner:0:1 -s
mailman    870  0.0  0.3  16604  7996 ?        S    Jul29   0:00 /usr/bin/python /usr/lib/mailman/bin/qrunner --runner=RetryRunner:0:1 -s
root       886  0.0  1.4  36800 30240 ?        Ss   Jul29   0:00 /usr/libexec/webmin/virtual-server/lookup-domain-daemon.pl
root       892  0.0  0.5  17224 10240 ?        Ss   Jul29   0:00 /usr/bin/perl /usr/libexec/usermin/miniserv.pl /etc/usermin/miniserv.conf
root       898  0.0  1.7  43056 36108 ?        Ss   Jul29   0:02 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
postgres  1058  0.0  0.2  50984  4920 ?        S    Jul29   0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
postgres  1060  0.0  0.0  19152  1284 ?        Ss   Jul29   0:00 postgres: logger process
postgres  1062  0.0  0.0  50984  1632 ?        Ss   Jul29   0:03 postgres: writer process
postgres  1063  0.0  0.0  50984  1416 ?        Ss   Jul29   0:02 postgres: wal writer process
postgres  1064  0.0  0.0  51120  1668 ?        Ss   Jul29   0:00 postgres: autovacuum launcher process
postgres  1065  0.0  0.0  19284  1444 ?        Ss   Jul29   0:00 postgres: stats collector process
root      1448  0.0  0.1  11916  3664 ?        Ds   06:01   0:00 sshd: root@pts/0
root      1487  0.0  0.0   6272  1680 pts/0    Ss   06:01   0:00 -bash
postfix   1541  0.0  0.1  13036  2512 ?        S    06:02   0:00 pickup -l -t fifo -u
root      1544  0.0  0.0   6080  1048 pts/0    R+   06:02   0:00 ps -auxw
513       3637  0.0  0.4  32708 10144 ?        S    00:40   0:00 /usr/bin/php-cgi
apache    6721  0.0  0.2  43608  4280 ?        S    01:15   0:00 /usr/sbin/httpd
apache    6723  0.0  0.2  43608  4260 ?        S    01:15   0:00 /usr/sbin/httpd
apache    7293  0.0  0.2  43608  4220 ?        S    01:29   0:00 /usr/sbin/httpd
apache   30698  0.0  0.2  43608  4260 ?        S    Jul29   0:00 /usr/sbin/httpd

I can't see how this discrepency could occur then, sorry. I'd need to actually login to your system myself to investigate further..