Stuff
MySQL Change Root Password
sudo nano /etc/mysql/my.cnf
- Add the following lines at the end:
[mysqld] skip-grant-tables
sudo service mysql restart
mysql -u root
use mysql
select * from mysql.user where user = 'root';
- Look at the top to determine whether the password column is called password or authentication_string
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
FLUSH PRIVILEGES;
exit
sudo nano /etc/mysql/my.cnf
- Remove the lines added in step 2
sudo service mysql restart
Import MySQL Database via SSH
- Login to SSH via root user
mysql -u username -p;
where username is your database username
- Enter MySQL Password
use database;
where database is your... well, you know :-)
SOURCE /path/to/sql/file.sql
SHOW tables;
To confirm the data was imported correctly
SELECT * from table;
Disable SQL Model 'ONLY_FULL_GROUP_BY'
- Login to SSH via root user
- mysql -u username -p;
- SET SESSION sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE'