Command line syntax - dumping individual tables in Mysql
I have backed up a lot of databases via the command line, but tonight I need to do some work on individual tables of a very large database. What is the syntax to dump individual tables in MySQL (Linux command line)?
You can also use database.tablename, and if you just use -p mysql will prompt you for the password. On some systems, users that can view processes will be able to see your password if you enter it directly at the shell prompt.
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise
OK, so I have a dump of an entire db that I am trying to move to another server. On the new server, the new db exists but is empty. How do I run my backup.sql file on this db? I login into Mysql, then switch to the db I want to use but I can't seem to find the command to run the file. What am I doing wrong?
mysql -u username -p databasename < /path/to/file.sql
I tried that and it wasn't working either. It turned out that when I was downloading the sql files to my Mac, it was converting Unix line breaks to Mac line breaks. When I uploaded the SQL file to the new server, it couldn't be imported correctly. Fixed now though.