Export and import existing users

on first machine dump mysql.user table: mysqldump -u root -p mysql --tables user > users.sql command will ask for password import file “users.sql” on second machine: mysql -u root -p mysql < users.sql WARNING: This does not work between some...

Find size o MySQL database

query in database: SELECT table_schema as "database_name", Round(Sum(data_length+index_length)/1024/1024,1) as "database_size_MB", Round(Sum(data_free)/1024/1024,1) as "Free_space_MB" FROM information_schema.tables GROUP BY table_schema; linux command: sudo du -h -d 1...

Allow remote access to mysql database

After installation mysql by default allows access from localhost. To access database from other IPs we have to do following steps: in /etc/mysql/my.cnf remove or comment out line bind-address = 127.0.0.1" grant remote access for username either from any IP: GRANT ALL...