Some useful MySQL commands

Grant privileges* on table: To grant SELECT, INSERT, UPDATE, and DELETE privileges on table name: data_table to a user name jdoe, you would run the following GRANT statement: GRANT SELECT, INSERT, UPDATE, DELETE ON data_table.* TO ‘jdoe’@’localhost’; *Privileges can be any of: SELECT, INSERT, UPDATE, DELETE, INDEX, CREATE, ALTER, DROP, GRANT, ALL Revoke privileges on […]

Linux MySQL

MySQL initial run

This serves to remind me how to initialise a new MySQL installation, if it doesn’t happen automatically. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password ‘new-password’ /usr/bin/mysqladmin -u root -h password ‘new-password’ Alternatively you can run: […]