This is my study note about mysql
MySQL
==============================================
http://www.mysql.com
Usages
———————
System parameters
*select version(),user(),current_date,now();
Install/Remove MySQL service
*mysql -install|remove
*net start|stop mysql (this command will not work if use mysqld –standalone)
*mysqladmin -u root -p shutdown(it works in all status)
Commands
*Cancel the command \c
Backup the data
*mysqldump -u root -ppasswd user|othertable|–all-database>backup.sql
Load the data from text file
*load data local infile ‘data.txt’ into table user;
Format of data.txt: spaced out by tab, use “\n” to replace null.
Grant privilege to users
*grant select,insert,delete,update on mysql.* to newuser@localhost;
Change the password
* mysqladmin -u root -p[oldpassword] password [newpassword]
Frequently Asked Questions
———————————–
How to provide transaction?
*CREATE TABLE ‘tablename’()TYPE=innoDB;
Note
————————————
Hibernate’s MySQL dialect
*hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
*hibernate.connection.url=jdbc\:mysql\://localhost/lidnux?useUnicode\=true&characterEncoding\=utf-8 #pay attention to ‘\’
*hibernate.connection.driver_class=com.mysql.jdbc.Driver