天龙八部mysql数据库安装
接下来安装MYSQL数据库。
启动虚拟机。不用进入桌面。
先准备两个软件。WinSCP3中文版和SecureCRT。WINSCP3设置用二进制。然后上传相关软件
两个软件的密码,都是刚才Linux系统的。123456
上传DBInit_0_31_0180_data_mysql.sql DBInit_0_31_0180_table_mysql.sql tlbbdb_stat.sql
mysql-5.0.45.tar.gz这四个文件。
然后看操作,一行一行复制回车运行。
cd /home
tar xzvf mysql-5.0.45.tar.gz
cd /home/mysql-5.0.45
./configure --prefix=/usr/local/mysql5.0.45 --with-charset=utf8 --with-extra-charsets=all --enable-thread-safe-client
make 这一步要10分钟,我暂停
好,接着下一个
make install
cp /usr/local/mysql5.0.45/share/mysql/my-small.cnf /etc/my.cnf 不管乱码,输入 Y 回车
修改/etc/my.cnf
在[mysqld] 和 [client]段都加入如下指令即可:
default-character-set=utf8
/usr/local/mysql5.0.45/bin/mysql_install_db
/usr/local/mysql5.0.45/bin/mysqld_safe --user=root & 启动mysql服务 回车。然后再回车
mysql -u root -p `进入mysql操作 密码为空直接回车确认
use mysql; update user set Password=PASSWORD('donglei') where User='root'; `XXXXX为你要设置mysql管理员的密码
GRANT ALL PRIVILEGES ON *.* TO " IDENTIFIED BY "donglei";
insert into mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) value ('192.168.1.%', 'tlbb', 'tlbb1234', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
insert into mysql.user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Create_user_priv, ssl_type, ssl_cipher, x509_issuer, x509_subject, max_questions, max_updates, max_connections, max_user_connections) value ('192.168.1.%', 'tlbbtools', 'tlbb1234', 'Y','Y','Y','Y','N','Y','N','N','N','N','N','Y','Y','N','N','N','Y','N','Y','N','N','Y','Y','N','N','N','','','','',0,0,0,0);
flush privileges;
create database tlbbdb;
create database tlbbdb_stat;
insert into mysql.db ( Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Execute_priv) value( '192.168.1.%', 'tlbbdb','tlbb', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
insert into mysql.db ( Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Execute_priv) value( '192.168.1.%', 'tlbbdb','tlbbtools', 'Y', 'Y', 'Y', 'Y', 'N', 'Y', 'N', 'Y', 'Y', 'N', 'Y', 'N', 'Y', 'Y', 'N', 'N', 'Y');
insert into mysql.db ( Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv, Create_view_priv, Show_view_priv, Create_routine_priv, Alter_routine_priv, Execute_priv) value( '192.168.1.%', 'tlbbdb_stat','tlbb', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N');
GRANT ALL PRIVILEGES ON *.* TO " IDENTIFIED BY "tlbb1234";
GRANT ALL PRIVILEGES ON *.* TO " IDENTIFIED BY "tlbb1234";
exit `退出mysql操作
导入数据库:
cd /home
mysql -uroot -pdonglei tlbbdb < DBInit_0_31_0180_table_mysql.sql
mysql -uroot -pdonglei tlbbdb < DBInit_0_31_0180_data_mysql.sql
mysql -uroot -pdonglei tlbbdb_stat < tlbbdb_stat.sql
安装完成。