Several Luddy School classes use MySQL databases hosted on the Luddy School MySQL server db.luddy.indiana.edu (aka. db.sice.indiana.edu). Every semester, we get a flurry of requests for help from student who are unable to access their database. This page is a collection of common problems and the resolution to help you solve your database access problems.
There are various options for database access for your research and class needs.
MS SQL
One of the first things you should do with your database is change the default password. Unfortunately, for some students the second thing they do is forget the new password they just set. Before you ask to have the password reset to the default, you can check your mysql history file and see if the password change line is there. You can do that by running this command on silo:
grep -i password ~/.mysql_history* |
There may be multiple password change lines so try every password in the list to see if you can get access.
If you successfully used the new password but don't see it in the mysql history file, it may be in your command line history. You can see the mysql commands you have run previously as follows:
grep mysql ~/.bash_history |
You may see the correct password in one of the --password arguments to the mysql command.
Incorrect --password Argument Syntax
When you specify the database password on the command line, you use the --password argument. The proper syntax of this argument is:
--password=your-password-here |
So, if your new password is "foobar1984" you would use:
--password=foobar1984 |
Note that --pass is a shorthand for --password that might work but is deprecated and is likely to generate a warning.
Extra Spaces in the --password Argument
When you are using the --password argument, you must not have any spaces. Do not put spaces before or after either of the hyphens or equal sign.
Passwords with Spaces
There is no reason you can't set a password with spaces. However, if you do that you will have to take care and quote the password if you are using the --password argument. For example, if your password is "my password with spaces" you would use:
--password='my password with spaces' |
You can also just use the -p argument and eliminate the --password argument completely. If you don't use --password and use -p then you are prompted for the password. When prompted you can just enter your password, complete with spaces, without any problem.
Special Characters in Password
There are some characters that have special meaning to the Linux shell and may cause you trouble if you have them in your MySQL password. Some that will be problematic are the following:
< > & ! ; ' " \ ? $ ~ | |
The best advice is to just not use these in your password in the first place. However, if you have already changed it and it includes one of these characters you can still get in. There are several ways around this problem and quoting the password as in the previous item (Passwords With Spaces) or you can just use the -p flag instead of --password and type the password at the prompt. When you get prompted for the password then you can enter a password with any of these special characters.
Incorrect Hyphen Characters
For all arguments to the mysql command, you will use the standard ascii hyphen (-). Some arguments use a single hyphen (like -u and D) and some use 2 hyphens (like --password). However, we have seen several cases where the hyphen caracter is cut/pasted from a web page and it turns it into a different hyphen character. The problem is that this "fake" hyphen looks nearly identical to the correct hypen (although it may look a little longer). So, you should re-type the command instead of just cutting/pasting it from a web page to make sure you have the proper hyphen.
Incorrect Database or Username
You will receive a database name and a MySQL account username from your instructor. In most cases, the database name and the username will be the same and of the form c123f18_username where "c123" will be your class (eg. i308) and the "f18" will indicate the semester and year (f=fall, s=spring, u=summer). Also, the "username" will be your official IU username. So, if your username is "janedoe" and you are in i308 in the Fall 2018 semester, your database name and MySQL username will be "i308f18_janedoe" so verify that you are using the correct values. Note that you will NEVER log into mysql using your IU username and passphrase. You will use your IU username and passphrase to log into a linux system like silo (aka burrow) but, once logged into the server, you will not use that to log into your mysql database.
Syntax and Typing Errors
Many of the problems students have are just simple typing errors. The mysql command you have to type is relatively long and there are lots of ways to type it incorrectly. So, go back to the class notes and VERY CAREFULLY compare what you are typing with what is in the examples.
If you have gone through all of these steps and are still having trouble, you are urged to first check with your instructor or AI. They have experience working with MySQL and may see a problem you are having. If you still aren't able to resolve the issue, then please let us know.
Guide information
Guide manager: Rob Henderson
Last updated: June 2023