1 、安装cmake

          wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz

          tar -zxvf cmake-2.8.10.2.tar.gz

          cd cmake-2.8.10.2

          ./configure

          make

          make install

          make clean

          到此 cmake安装完毕

2 、安装 mysql

       1 把下载好的mysql安装包上传到linux服务器  (当前用的是mysql-5.6.45.tar.gz)

2 检查是否已经安装mysql

      rpm -qa | grep mysql  (如果已经安装了需先卸载)  

        rpm -e --nodeps mysql-libs-5.1.61-4.el6.x86_64  (卸载mysql 卸载版本名称以实际的为准)

3 安装mysql

yum -y install make gcc-c++ bison-devel  ncurses-devel  //安装mysql所需要的依赖包          groupadd mysql (增加mysql用户组)

          useradd -g mysql -s /sbin/nologin mysql  (增加mysql用户 不允许直接登录)

          tar -zxvf mysql-5.6.26.tar.gz

          cd mysql-5.6.26

          cmake .
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_DATADIR=/usr/local/mysql/data
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DEXTRA_CHARSETS=all
-DENABLED_LOCAL_INFILE=1 (cmake 编译mysql)
make
make install
make clean
chown -R mysql:mysql /usr/local/mysql chmod 755 /usr/local/mysql/scripts/mysql_install_db (赋给文件执行权限) /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld chmod 755 /etc/init.d/mysqld chkconfig --add mysqld chkconfig mysqld on
      

       编辑 /etc/init.d/my.cnf //mysql的配置文件写入如下内容 根据实际情况修改
      #########################################################

[client]
             default-character-set = utf8
             port = 3306
             socket = /tmp/mysql.sock




[mysqld]
            socket=/tmp/mysql.sock
            port = 3306
            basedir = /usr/local/mysql
            datadir=/www/mysql/data
            pid-file = /www/mysql/data/mysql.pid
            user = mysql
            bind-address = 0.0.0.0
            server-id = 1
            skip-name-resolve
            back_log = 600
            max_connections = 1000
            max_connect_errors = 6000
            open_files_limit = 65535
            table_open_cache = 128
            max_allowed_packet = 4M
            binlog_cache_size = 1M
            max_heap_table_size = 8M
            tmp_table_size = 16M




read_buffer_size = 2M
            read_rnd_buffer_size = 8M
            sort_buffer_size = 8M
            join_buffer_size = 8M
            key_buffer_size = 4M


thread_cache_size = 8


query_cache_size = 8M
            query_cache_limit = 2M


ft_min_word_len = 4


log_bin = mysql-bin
            binlog_format = mixed
            expire_logs_days = 30


log_error = /www/mysql/data/mysql-error.log
            slow_query_log = 1
            long_query_time = 1
            slow_query_log_file = /www/mysql/data/mysql-slow.log


performance_schema = 0
            explicit_defaults_for_timestamp


#lower_case_table_names = 1


skip-external-locking


default_storage_engine = InnoDB
            #default-storage-engine = MyISAM
            innodb_file_per_table = 1
            innodb_open_files = 500
            innodb_buffer_pool_size = 64M
            innodb_write_io_threads = 4
            innodb_read_io_threads = 4
            innodb_thread_concurrency = 0
            innodb_purge_threads = 1
            innodb_flush_log_at_trx_commit = 2
            innodb_log_buffer_size = 2M
            innodb_log_file_size = 32M
            innodb_log_files_in_group = 3
            innodb_max_dirty_pages_pct = 90
            innodb_lock_wait_timeout = 120


bulk_insert_buffer_size = 8M
            myisam_sort_buffer_size = 8M
            myisam_max_sort_file_size = 10G
            myisam_repair_threads = 1


          interactive_timeout = 28800

wait_timeout = 28800




[mysqldump]
              quick
              max_allowed_packet = 16M




[myisamchk]
              key_buffer_size = 8M
              sort_buffer_size = 8M
              read_buffer = 4M
              write_buffer = 4M



      
    ##########################################################
      

service mysqld restart 添加到环境变量 vi /etc/profile 添加如下代码 export PATH="$PATH:/usr/local/mysql/bin" source /etc/profile 登录mysql mysql -uroot -p //登陆mysql 第一次登陆的时候不需要输入密码 use mysql; delete from user where User=''; //删除用户名为空的用户 UPDATE user SET password=PASSWORD("123456") WHERE user='root'; //修改root用户的密码 mysql增加用户的命令 grant all privileges on db_test.* to db_user@"%" identified by '123456' with grant option; 这样就为 数据库 db_test 增加了一个 db_user的用户操作的权限 默认密码为 123456 flush privileges;//刷新权限

重启服务器,看mysql是否随着开机启动
     

最新文章

  1. Python3 连接Mysql
  2. POJ3084 Panic Room(最小割)
  3. CF#335 Sorting Railway Cars
  4. UVM Top Testbench
  5. laravel----------Client error: `POST http://47.98.116.219/oauth/token` resulted in a `401 Unauthorized` response: {"error":"invalid_client","message":"Client authentication failed"}
  6. android studio git 将项目分享到github,推送到其他平台 码云 等。
  7. js获取url传值的方法
  8. os.path 模块
  9. django-simple_tag、filter
  10. mysql高可用架构 -> MHA主从复制-03
  11. 记一次为gitlab启用CI的过程
  12. spark dataset join 使用方法java
  13. mongo connect BI 连接至Power BI
  14. 编写高质量代码改善C#程序的157个建议——建议9: 习惯重载运算符
  15. asp.net 过滤器
  16. Linux静默安装weblogic
  17. DP【洛谷P2295】 MICE
  18. CodeForces 778D Parquet Re-laying 构造
  19. L98
  20. js 获取data-属性值

热门文章

  1. 4-发票校验-不可能为条目1000 DIF确立帐户-消息号 M8147
  2. VS2019+ Intel Fortran (oneAPI)+HDF5库的安装+测试
  3. 手把手XTTS_V4迁移
  4. [AGC043B] 123 Triangle
  5. abc285h题解
  6. 在子组件中使用$parent获取不到父组件里的变量值?
  7. el-pagination分页-自定义左右箭头样式
  8. react native 更改项目包名
  9. 寻找进程ID
  10. 逆向学习物联网-网关ESP8266-00课程目的