Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my first time using MySQL. I have Windows and XAMPP installed .

I have created a database called "Students" through my Java program that shows up as a folder in the C:\xampp\mysql\data directory, and in localhost/phpmyadmin/. I can query tables in the database from Java.

In the Xampp folder, mysql.exe is found in C:\xampp\mysql\bin. This is what displays from the prompt there:

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+

Files with these names exist in C:\xampp\mysql\mysql-test.

I was expecting to see my database here. I gather perhaps I can tell it to look in a different place by editing the my.cnf file. But there is one in C:\xampp\mysql\mysql-test\suite\rpl and one in C:\xampp\mysql\mysql-test\suite\federated. Neither contains "datadir". Am I on the right path? What do I do?

share|improve this question
    
Did you create the Students DB using the same user account? SHOW DATABASES will only show databases you have privileges to. – ernie Jun 22 '13 at 0:10
    
In the Java program, I supply user:root and the password. I haven't thought about this at all when using the prompt, I just type "mysql" from cmd and then "show databases". Is this the problem? – mxl_ Jun 22 '13 at 0:27
    
Yes it was! Showing fine now. If you want to post the answer, I'll accept it. – mxl_ Jun 22 '13 at 0:35
up vote 2 down vote accepted

Did you create the Students DB using the same user account? SHOW DATABASES will only show databases you have privileges to.

share|improve this answer
1  
This was the problem. I needed to supply the same user and password that I created the database with when I launched the MySQL command line (in my case "mysql -u root -p"). – mxl_ Jun 23 '13 at 17:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .