Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 1 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.