[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中设置客户端与服务器端字符集