MySQL二进制安装

来源:转载

MySQL二进制安装 Installation steps

  • IP:183
  • 版本:5.6.24
  • 软件安装目录: /usr/local/mysql
  • 安装包文件保存: /caihao/mysql_install
  • 数据文件位置: data/db/mysql/3306

下载软件

http://downloads.mysql.com/archives/get/file/mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz

开始安装

useradd mysqlcd /tmp; tar -xzf mysql-5.6.24-linux-glibc2.5-x86_64.tar.gz -C /usr/localcd /usr/local; mv mysql-5.6.24-linux-glibc2.5-x86_64 mysqlchown -R root.root mysqlmkdir -p /data/db/mysql/3306chown mysql.mysql /data/db/mysql/3306cd /usr/local/mysqlscripts/mysql_install_db --defaults-file=/data/db/mysql/3306/my.cnf --user=mysqlbin/mysqld_safe --defaults-file=/data/db/mysql/3306/my.cnf --user=mysql &export MYSQL_UNIX_PORT=/data/db/mysql/3306/mysql.sockbin/mysql_secure_installation

导入环境变量

echo "export PATH=$PATH:/usr/local/mysql/bin">>/etc/profile source /etc/profile

如果绝对路径启动,加参数

basedir = /usr/local/mysqlledir = /usr/local/mysql/bin

检查端口是否启动

[[email protected] ~]# netstat -nplat |grep mysqldtcp0 0 0.0.0.0:33060.0.0.0:* LISTEN 9146/mysqld [[email protected] ~]#

检查登录密码是否修改

 mysql -uroot -S/data/db/mysql/3306/mysql.sock -p mysql> /s--------------mysql Ver 14.14 Distrib 5.6.24, for linux-glibc2.5 (x86_64) using EditLine wrapperConnection id: 1Current database:Current user: [email protected]:Not in useCurrent pager: stdoutUsing outfile: ''Using delimiter:;Server version: 5.6.24-log MySQL Community Server (GPL)Protocol version: 10Connection: Localhost via UNIX socketServer characterset:latin1Db characterset:latin1Client characterset:utf8Conn. characterset:utf8UNIX socket:/data/db/mysql/3306/mysql.sockUptime: 10 min 27 secThreads: 1 Questions: 9 Slow queries: 0 Opens: 70 Flush tables: 1 Open tables: 63 Queries per second avg: 0.014--------------mysql> 

检查test库是否已经删除

mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema |+--------------------+3 rows in set (0.00 sec)

———————–附件: my.cnf——————————-

[client]port = 3306socket = /data/db/mysql/3306/mysql.sock[mysqld]port = 3306socket = /data/db/mysql/3306/mysql.sockbasedir = /usr/local/mysqldatadir = /data/db/mysql/3306pid-file = /data/db/mysql/3306/mysql.piduser = mysqlbind-address = 0.0.0.0server-id = 1skip-name-resolve#skip-networkingback_log = 600max_connections = 1000max_connect_errors = 6000open_files_limit = 65535table_open_cache = 128 max_allowed_packet = 4Mbinlog_cache_size = 1Mmax_heap_table_size = 8Mtmp_table_size = 16Mread_buffer_size = 2Mread_rnd_buffer_size = 8Msort_buffer_size = 8Mjoin_buffer_size = 8Mkey_buffer_size = 4Mthread_cache_size = 8query_cache_size = 8Mquery_cache_limit = 2Mft_min_word_len = 4log_bin = mysql-binbinlog_format = mixedexpire_logs_days = 30log_error = /data/db/mysql/3306/mysql-error.logslow_query_log = 1long_query_time = 1slow_query_log_file = /data/db/mysql/3306/mysql-slow.logperformance_schema = 0explicit_defaults_for_timestamp#lower_case_table_names = 1skip-external-lockingdefault_storage_engine = InnoDB#default-storage-engine = MyISAMinnodb_file_per_table = 1innodb_open_files = 500innodb_buffer_pool_size = 64Minnodb_write_io_threads = 4innodb_read_io_threads = 4innodb_thread_concurrency = 0innodb_purge_threads = 1innodb_flush_log_at_trx_commit = 2innodb_log_buffer_size = 2Minnodb_log_file_size = 32Minnodb_log_files_in_group = 3innodb_max_dirty_pages_pct = 90innodb_lock_wait_timeout = 120bulk_insert_buffer_size = 8Mmyisam_sort_buffer_size = 8Mmyisam_max_sort_file_size = 10Gmyisam_repair_threads = 1interactive_timeout = 28800wait_timeout = 28800[mysqldump]quickmax_allowed_packet = 16M[myisamchk]key_buffer_size = 8Msort_buffer_size = 8Mread_buffer = 4Mwrite_buffer = 4M



分享给朋友:
您可能感兴趣的文章:
随机阅读: