Skip to main content

list of mysql commands

here are tutorial list of mysql commands to preparing database for your web+cms needs

enter database server by using mysql client
 $ mysql -u root mysql

to create database
mysql> CREATE DATABASE namedb;

to create user database and password
mysql>CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

to grant access user to database create
mysql>GRANT ALL ON namedb.* TO 'user'@'localhost';

to make configuration active
mysql>FLUSH PRIVILEGES;

to exit mysql
mysql>EXIT

to show user, host and password
mysql>SELECT user,host,password FROM user;

to show databases
mysql>SHOW DATABASES;

to open database
mysql>USE namedb;

to remove database
mysql>DROP DATABASE namedb;

to remove user
mysql>DROP USER 'user'@'localhost';

to backup all databases
mysql>MYSQLDUMP --all-databases > backup.sql

to restore database
mysql>MYSQL -u username -p < backup.sql


Comments

Popular posts from this blog

about gigabyte NIC onboard not detected on enterprise linux distribution

on several gigabyte motherboard, onboard network interface card  will not be detected on enterprise linux distribution (e.g. scientific linux, oracle linux server, etc). alternatively you must supply add-on card. or if you insist to use the onboard card, you must install the unofficial nic driver. this is tutorial how to install driver for onboard network interface card GIGABYTE first of all prepare your system. make sure it has package group "Development Tools" installed. if it has not, install it # yum groupinstall “Development Tools” download the source code : https://www.dropbox.com/s/na91bu4az4p9827/AR81Family-linux-v1.0.1.14.tar.gz extract the source code : # tar zxvf AR81Family-linux1.0.1.14.tar.gz the extraction process will make the new directory "AR81Family*", change to the directory # cd AR81Family* compile the source by type on terminal : # make then, # make install wait until the compiling process finish. next make the new scrip...

about getsebool and setsebool

The setsebool is used to set SELinux boolean value i.e. various configurations can be enabled or disabled using this tool. In other words, the setsebool command switches on and off the protection of SELinux. Type getsebool -a to see all such options which can be enabled or disabled at run time: e.g. # getsebool -a The following should give you a complete listing of all the vsftpd switches: e.g.  # getsebool -a | grep ftp  For example, if httpd_disable_trans set to 1, it will disable SELinux protection for  Apache web server. To disable it, enter:  # setsebool -P httpd_can_network_connect=1 To enable it, enter:    # setsebool -P httpd_can_network_connect=0

All certification