Skip to main content

Posts

Showing posts with the label mysql

Exclude or Include table(s) during creating backup from MySQL

 To exclude tables when you are creating database backup from MySQL, execute below query. mysqldump -u root -p<Password> DATABASENAME --ignore-table= DATABASENAME.TABLENAME  > BACKUPFILENAME.sql  To include  tables when you are creating database backup from MySQL, execute below query. mysqldump -u root -p<Password> DATABASENAME TABLENAME1 TABLENAME2  > BACKUPFILENAME.sql Take note that there is no whitespace between -p and the password..

View all procedures/functions - MySQL

View all procedures/functions To view all procedures/functions used in MySQL, use below query. show procedure status; show function status; To view all procedures/functions used in selected database, use below query. show procedure status where db = database() and type = 'procedure'; show function status where db = database() and type = 'function';

Create users in MySQL

Create users The following steps are explained to you how create the users in MySQL. This query is used to create a user in the particular host only,   create user 'username'@'hostname' identified by 'password'; This user cannot access from the other hosts If you want to the user access from other machines then use the below query, create user 'username'@'%'; The below query is used to give the all privileges to the user on the particular database, grant all privileges on '<database>.<tables>' to 'username'@'hostname'; The below query is used to give some privileges to users on the particular database, grant select,update on '<database>.<tables>' to 'username'@'hostname';