Connecting from a shell account
- To log in to your MySQL database, you'll need your database credentials. View the 'Finding your database credentials' article for instructions. You can also find these in the panel under MySQL Databases.
- You'll then need a terminal to run the following command. You can do this in a Mac or Linux computer using the native terminal, or you could just log into your DreamHost web server instead via SSH. If you're on Windows, use PuTTY to connect to your DreamHost server, then run the following command.
- Make sure to use your actual credentials for the following variables:
- DHhostname - Your mysql hostname URL. It will appear like 'mysql.example.com'.
- DBuser - Your database username
- DBpassword - Your database username's password
- DBname - Your database name
[server]$ mysql -h <DBhostname> -u <DBuser> -p <DBname>
- You are then prompted for your password to log in.
- Once logged in, your command prompt will change to the following:
You cannot use "localhost" to connect to your database, as DreamHost's MySQL servers are separate from the regular web site servers.
- SSH overview
- MySQL overview
- Finding your database login credentials
- How do I restore my database in the panel?
- How do I manage my database?
- How do I connect to my database using a third-party program?
- How do I connect to my database using SQLyog?
- Troubleshooting your MySQL database
- MySQL limitations due to shared hosting