Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2012-08-15 15:36:29
- tester
- Member
- Registered: 2012-08-01
- Posts: 10
command line mysql vs phpmyadmin
I am in the process of trying to figure out mysql. So I went into mysql to show databases and it seems like the list of databases showing up there do not match the list phpmyadmin gives me. Are there different mysqls stored in different places? If so, how do I access the one that is in my phpmyadmin from the command line? If not, then why am I seeing different databases? Although I have been up all night trying to figure this out, I can attest that I am not hallucinating as someone next to me has verified that different databases are indeed showing up.
ETA: The reason why I want to know this is because I am in the process of updating a local copy of the database. When I run
mysqldump --user=USER -p < backup.sql
it seems to be updating a different mysql than the one in phpmyadmin. So after some snooping around I discovered that it is altering a mysql located at
/var/lib/mysql
where the phpmyadmin one is located in
/opt/lampp/var/mysql
so I went to my.cnf and modified this line:
socket=/var/run/mysql.sock
to
socket=/opt/lampp/var/mysql/mysql.sock
and added this line also under [mysqld]
datadir=/opt/lampp/var/mysql
Yet when I go to mysql and type
select @@datadir;
It still shows /var/lib/mysql. And I have stopped and started the service.
How can I fix this so that I update the xampp mysql instead of the default linux one?
Last edited by tester (2012-08-15 17:32:15)
Offline
Re: command line mysql vs phpmyadmin
There is nothing wrong to precise. You are merely accessing different executable. Note that mysqldump shorthand isn’t the executable coming with your XAMPP stack, but you are accessing entirely different application which is why your are seeing differences. E.g.
$ which mysqldump
The above gives you the real path of the mysqldump your are accessing. Instead of accessing that mysqldump
(where ever it’s loaded from), access the actual mysqldump application coming with XAMPP stack. E.g.
$ /opt/lampp/var/mysqldump --help
If you want mysqldump and mysql shorthands to point to the ones coming with XAMPP, then break the current PATH environment variables (or how ever it’s set it up) and change them to point to the ones coming with XAMPP.
Offline
#3 2012-08-18 16:09:10
- tester
- Member
- Registered: 2012-08-01
- Posts: 10
Re: command line mysql vs phpmyadmin
Thanks,
I also needed to change the section under [client] in the my.cnf to include this line:
socket=/opt/lampp/var/mysql/mysql.sock
Posting this here in case anyone else has a similar problem.
Offline