Frequently Asked Questions

The NearlyFreeSpeech.NET FAQ (*)

MySQL (*)

How do I get a MySQL process?

Ok, I have a MySQL process. How do I create a database?

What is the DSN (hostname) I should use to connect to my MySQL database?

What is the difference between a MySQL process and a MySQL database?

If I lose my MySQL admin user password, can you help me get it back?

How do I access my MySQL database process from the ssh server command line?

Can I use ssh port forwarding to access my MySQL database from a remote location?

Where can I find more information on properly creating MySQL users?

What are the default databases present in my MySQL process?

Why do I have to pay for a stopped MySQL process?

When I change my member password, do my MySQL passwords change too?

Why do I get an error "Cannot log in to the MySQL server" when I try to log in to phpMyAdmin?

What does the MySQL Error Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) mean? (or socket 'please_see_the_faq')

When I try to log in to phpMyAdmin I get the error "the username was not provided." What should I do?

Why shouldn't I use my MySQL admin username from my web site?

What 'Host' value should I use when creating MySQL users?

How can I remove my MySQL process?

How do I enable or disable InnoDB for my MySQL process?

How can I make automatic backups of MySQL?

Ordinarily, we prohibit unattended access to our systems. However, there's an exception for backups, and this definitely qualifies.

There are basically three parts:

  1. Something on your local computer to schedule/run the backups. On a Unix system or Mac, this would be "cron." Windows has a way to do the same thing, but we are not familiar with it. So you set this up to run a task every time you want the backup to happen. (E.g. once a week.)

  2. Something to connect to our system and cause the backups to happen. This is a programmable or command line ssh client.

  3. Something on our side to do the backups from our shell. This is the "mysqldump" command line utility. This is typically invoked like:

    YourNFSNPrompt> mysqldump --user=youradminusername --password=yourpassword --host=yourprocess.db

    This command spews the backup directly to standard output, so you generally want to send it somewhere after that. If you happened to be using a Unix machine on your side and the OpenSSH client, you could do something like:

    YourLocalPrompt> ssh yourname_yoursite@ssh.phx.nearlyfreespeech.net mysqldump --user=youradminusername --password=yourpassword --host=yourprocess.db | gzip >backup-yourprocess-20120627.sql.gz

That would create a compressed SQL file on your system containing a full backup of your MySQL process on our system. To do this in an unattended way, you would need an ssh public key installed on our system that has no passphrase on the private key on your local machine. (Unless you do something super-elaborate with ssh agents, which is possible but beyond the scope of advice we can provide.)

Since the MySQL password you're using will be in the above command, we recommend creating a separate MySQL user with the minimum privileges necessary (i.e. SELECT) to do backups. You could do that from phpMyAdmin or with SQL similar to:

MySQL> CREATE USER backup IDENTIFIED BY 'b2liu44fbh2f3bhjfhj3';
MySQL> GRANT SELECT ON *.* TO backup;

Then use backup and b2liu44fbh2f3bhjfhj3 (being sure to use a fresh random password and not this example one) in lieu of your normal MySQL username and password in the mysqldump commands above.

This will take some (or a lot of) tweaking depending on what you've got on your end, but that's the gist of how it can work.

What username and password do I use to administer my MySQL process?

What does it mean that my MySQL process is "damaged?"

How do I upgrade from MariaDB 5.3 to MariaDB 10.x?

Why do newly-created MySQL processes seem so expensive?

How do I enable or disable MySQL logs?