mySQL Notes

From Wiki
Jump to navigationJump to search
  • To modify the size or type of a field:
ALTER TABLE tablename MODIFY fieldName VARCHAR(20);
  • To rename a field in a table:
ALTER TABLE tablename CHANGE COLUMN oldname newname definition;
  • To dump the database with INSERT for each line:
mysqldump [-h <mysql_host>] [-p<password>] [--hex-blob] --skip-extended-insert <database_name>
  • To force boxing around mysql command line output to a redirect:
mysqldump -t [...]