Stuff

MySQL Change Root Password

  1. sudo nano /etc/mysql/my.cnf
  2. Add the following lines at the end:[mysqld] skip-grant-tables
  3. sudo service mysql restart
  4. mysql -u root
  5. use mysql
  6. select * from mysql.user where user = 'root'; - Look at the top to determine whether the password column is called password or authentication_string
  7. UPDATE mysql.user set *password_field from above* = PASSWORD('your_new_password') where user = 'root' and host = 'localhost'; - Use the proper password column from above
  8. FLUSH PRIVILEGES;
  9. exit
  10. sudo nano /etc/mysql/my.cnf
  11. Remove the lines added in step 2
  12. sudo service mysql restart

Import MySQL Database via SSH

  1. Login to SSH via root user
  2. mysql -u username -p; where username is your database username
  3. Enter MySQL Password
  4. use database; where database is your... well, you know :-)
  5. SOURCE /path/to/sql/file.sql
  6. SHOW tables; To confirm the data was imported correctly
  7. SELECT * from table;

Disable SQL Model 'ONLY_FULL_GROUP_BY'

  1. Login to SSH via root user
  2. mysql -u username -p;
  3. SET SESSION sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE'