======= MySQL tar包下载安装 =====
如果不删掉会有许多莫名其妙的问题
find / -name mysql 全部 rm -rf
find / -name mysqld 全部 rm -rf
find / -name my.cnf 全部 rm -rf
1.卸载mariadb
rpm -qa|grep mariadb
rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
2.卸载my.cnf
rm -rf /etc/my.cnf
3.检查MySQL存在,存在删除
rpm -qa | grep mysql
4.MySQL用户、组
cat /etc/group | grep mysql
cat /etc/passwd | grep mysql
groupadd mysql
useradd -g mysql mysql
5.解压tar包、创建数据库目录、授权操作
tar -zxvf mysql.tar.gz
chown -R mysql /application/mysql-5.6.16/
chgrp -R mysql /application/mysql-5.6.16/
6.安装(提示警告信息,Please consider using --initialize instead)
/application/mysql-5.6.16/scripts/mysql_install_db --user=mysql --basedir=/application/mysql-5.6.16/ --datadir=/application/mysql-5.6.16/data/
Can't locate Data/Dumper.pm in
yum install 'perl(Data::Dumper)'
yum install perl-Module-Install.noarch
7.新建my.cnf、授权
cp /application/mysql-5.6.16/my.cnf /etc/my.cnf
vi /etc/my.cnf
[mysql]
设置mysql客户端默认字符集
default-character-set=utf8
socket=/tmp/mysql.sock
[mysqld]
skip-name-resolve
skip-grant-tables
设置3306端口
port=3306
basedir=/application/mysql-5.6.16/
datadir=/application/mysql-5.6.16/data
socket=/tmp/mysql.sock
user=mysql
symbolic-links=0
lower_case_table_names=1
允许最大连接数
max_connections=5000
服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
max_allowed_packet=1024M
chown 777 /etc/my.cnf
在mysql目录添加my.ini
root]cd /application/mysql-5.6.16/
root]vim my.ini
[client]
default-character-set=utf8
[mysqld]
basedir = /application/mysql-5.6.16
datadir = /application/mysql-5.6.16/data
server_id = 1
socket = /tmp/mysql.sock
log-error = /application/mysql-5.6.16/data/mysqld.err
slow_query_log = 1
slow_query_log_file=/application/mysql-5.6.16/data/slow-query.log
long_query_time = 1
log-queries-not-using-indexes
max_connections = 5000
back_log = 3000
wait_timeout = 86400
interactive_timeout = 7200
key_buffer_size = 16777216
query_cache_size = 3145728
query_cache_type = 1
query_cache_limit = 1048576
max_connect_errors = 100
sort_buffer_size = 868352
max_allowed_packet = 1073741824
join_buffer_size = 442368
thread_cache_size = 100
innodb_buffer_pool_size = 12884901888
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8388608
innodb_log_file_size = 1572864000
innodb_log_files_in_group = 2
log-bin=/application/mysql-5.6.16/data/mysqlbin
binlog_cache_size = 2097152
max_binlog_cache_size = 2048M
max_binlog_size = 524288000
expire_logs_days = 0
read_buffer_size = 868352
read_rnd_buffer_size = 442368
bulk_insert_buffer_size = 4194304
root] chown mysql:mysql my.ini
8.启动
cp /application/mysql-5.6.16/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
service mysqld start
停止3306端口正在启动的任务
lsof -i:3306
The server quit without updating PID file
检查配置文件中未创建的文件夹
9.环境变量
vi /etc/profile
MYSQL
export MYSQL_HOME="/application/mysql-5.6.16/"
export PATH="$PATH:$MYSQL_HOME/bin"
source /etc/profile
10.获取初始密码
cat /root/.mysql_secret
PbJQmpFl
ERROR 1290 (HY000): The MySQL server is running with the
flush privileges
更改密码
mysql -uroot -p
set PASSWORD = PASSWORD('123456');
flush privileges;
远程访问
use mysql
select host,user from user;
create user 'root'@'%' identified by '123456';
grant all privileges on mysql.* to root@'%' identified by '123456';
grant all privileges on mysql.* to root@'%' identified by 'mysql243';
11.防火墙打开3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
===== mysql treesoft监控软件安装 ======
1、将压缩文件解压(程序文件中已包括windows版本的JDK1.7, tomcat7.0, treesoft项目)。
2、Linux服务器的Tomcat,JDK请自行安装,支持JDK1.7+。
3、treeDMS-2.X.X\webapps\treesoft目录内容为编译后的程序,直接上传到服务器Tomcat的webapps目录中。
4、启动Tomcat。
5、打开浏览器,输入http://127.0.0.1:8080/treesoft访问系统(IP,端口按实际修改)
6、能打开TreeSoft数据库管理系统登录页,说明安装成功!
7、默认用户名:admin 、treesoft,密码均为:treesoft,登录后请及时修改密码。
8、登录后,点击右上角参数配置按钮,打开配置数据库连接信息,并测试保存信息。