Ruby Code 1. open my. add the following parameter to the cnf file: [client]: Add default-character-set = utf8. The following is a code snippet: [client] www.2cto.com # password = [your_password] port = 3306 socket =/tmp/mysql. sock default-character-set = utf8 [mysqld] default-storage-engine = INNODB character-set-server = utf8 collation-server = utf8_general_ci # generic configuration options port = 3306 socket =/ tmp/mysql. sock 2. After the settings are complete, restart mysql service mysql restart 3. After connecting to your database, enter the command: show variables like '% char % '; now you can see the character set used by your database: the default password is blank during the first installation. You can use the following command to change the root password, mysqladmin-u root password mypassword the new password www.2cto.com mysql directory you set is described as follows: description: The default installation directory/var/lib/mysql data file directory/usr/share/mysql configuration file directory/usr/bin program directory/etc/rc. d/init. d/mysql STARTUP script | stop | view the server/etc/rc. d/init. d/mysql start | stop | status/usr/bin/mysqladmin-u root-ppassword shutdown
Change the data file directory mv/var/lib/mysql/data/cp/usr/share/mysql/my-medium.cnf/etc/my. cnf vi/etc/my. cnf modifies the socket =/data/mysql for the client and mysqld groups. sock vi/etc/rc. d/init. d/mysql modify datadir =/data/mysql export database and data mysqldump-u root-p dbname> 20101216_test. SQL export data do not export structure mysqldump-t database name-uroot-p> xxx. SQL export the structure of a specific table mysqldump-u root-p-B database name -- table Name> xxx. SQL export structure does not export data mysqldump -- opt-d database name-u root-p> xxx. configure JAVA environment variable JAVA_HOME =/usr/java/jdk1.7.0 _ 03 PATH = $ JAVA_HOME/bin: $ path classpath =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar export JAVA_HOME export PATH export CLASSPATH author dream_ait