[root@mylinux mysql]# ./scripts/mysql_install_db --user=mysql --data=/application/mysql/data/ Installing MySQL system tables... 170711 22:09:40 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 170711 22:09:40 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap. 170711 22:09:40 [Note] ./bin/mysqld (mysqld 5.5.56-log) starting as process 28738 ... OK Filling help tables... 170711 22:09:41 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release. 170711 22:09:41 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap. 170711 22:09:41 [Note] ./bin/mysqld (mysqld 5.5.56-log) starting as process 28745 ... OK
To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands:
Alternatively you can run: ./bin/mysql_secure_installation
which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/ 添加啟動腳本與設置開機啟動
mysql> SHOW [{GLOBAL|SESSION}] VARIABLES [LIKE '']; mysql> SELECT @@{GLOBAL|SESSION}.VARILABLE_NAME; mysql> SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='NAME'; mysql> SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='NAME'; 修改變量:默認僅管理員有權限修改全局變量
mysql> SET {GLOBAL|SESSION} VARIABLE_NAME='VALUE'; 注意:無論是全局還是會話級別的動態變量修改,在重啟mysqld后都會失效;想永久有效,可定義在配置文件中的相應段中[mysqld]。
1.6、MySQL中文數據亂碼解決辦法
1)、向表中插入數據之前先設置客戶端的字符集與表保持一致
SELECT CREATE TABLE tb_name /G 查看表的字符集 set names 字符集; 2)、在SQL文件中指定字符集然后登陸MYSQL導入數據
source tb_namq.sql; 3)、在SQL文件中指定字符集,通過mysql命令導入數據
mysql -uroot -p’password’ tb_name<tb_name.sql 4)、指定mysql命令設置字符集
mysql -uroot -p’password’ --default-character-set=字符集 tb_name<tb_name.sql 5)、配置文件my.cnf中設置客戶端與服務器端字符集