find location of database files
MySQL 1. Connect to the mysql console: # mysql -p 2. Look the value of 'datadir' variable to find the location of database files: mysql> SHOW VARIABLES WHERE Variable_Name =…
mysql: change a user’s password
1. Login to mysql server with a user with enough privileges (usually root) $ mysql -u root -p 2. Select the database 'mysql' mysql> use mysql; 3. Modify the password…
mysql: show grants of all users
Unfortunately, there's no a single MySQL command to display all privileges granted to all users, but that information can be gathered with the following procedure: 1. Login as root (or…
Set up a master/slave replication in MySQL
Follow this step by step procedure to replicate a MySQL server (master) to another (slave): 1. CONFIGURE THE MASTER Enable binary log. To do this, add in / under section:…
mysql: ‘%’ doesn’t match localhost and/or hostname
PROBLEM: You granted access privileges to a user connecting from anywhere using this command: mysql> GRANT ALL PRIVILEGES ON *.* TO prueba@'%' IDENTIFIED BY 'password' Then, when you try to…
MySQL cheatsheet
Show MySQL configuration settings mysql> SHOW VARIABLES; Show MySQL running threads mysql > SHOW PROCESSLIST; Check the status of the tables of a database $ mysqlcheck -c <database>