zoukankan      html  css  js  c++  java
  • mariadb 压缩包gz安装方式

    1.解压安装包
    tar -zxvf mariadb-5.5.56-linux-x86_64.tar.gz

    2.cd support-files
    cp my-small.cnf /etc/my.cnf

    2.修改配置文件
    [mysqld]
    port = 3306
    basedir = /home/marridb/mariadb-5.5.56-linux-x86_64
    socket = /home/marridb/mariadb-5.5.56-linux-x86_64/mysql.sock
    datadir = /home/marridb/mariadb-5.5.56-linux-x86_64/data/marridb
    skip-external-locking
    key_buffer_size = 256M
    max_allowed_packet = 64M
    table_open_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    read_rnd_buffer_size = 4M
    myisam_sort_buffer_size = 64M
    thread_cache_size = 8
    query_cache_size= 16M
    thread_concurrency = 8
    log-bin=mysql-bin
    binlog_format=mixed
    server-id = 1
    lower_case_table_names = 1
    init_connect='SET collation_connection = utf8_unicode_ci'
    init_connect='SET NAMES utf8'
    character-set-server=utf8
    collation-server=utf8_unicode_ci
    skip-character-set-client-handshake


    3.初始化数据库
    scripts/mysql_install_db --datadir=/home/marridb/mariadb-5.5.56-linux-x86_64/data --defaults-file=/etc/my.cnf --user=mysql

    chown -R root .
    cp support-files/mysql.server /etc/init.d/mysqld

    chkconfig --add mysqld # 添加至系统服务
    chkconfig mysqld on # 设置开机自启动

    4.后台运行
    cd bin
    mysqld_safe --datadir='/home/marridb/mariadb-5.5.56-linux-x86_64/data' &

    5.link 文件
    ln -s /home/marridb/mariadb-5.5.56-linux-x86_64/mysql.sock /tmp/mysql.sock

    6.测试
    cd bin
    ./mysql

    7.设置密码
    mysqladmin -u root password "root123456"

    8.登录并授权
    mysql -uroot -p

    9.root可从任何IP登录
    mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypwd' WITH GRANT OPTION;
    mysql>FLUSH RIVILEGES;

  • 相关阅读:
    Win7下安装iMac系统
    Windows平台cocos2d-x 3.0 android开发环境
    iOS Dev (50)用代码实现图片加圆角
    内部消息 微软中国云计算 内測Azure免费账号 赶紧申请 错过不再有
    android锁屏软件制作
    CF1019E Raining season
    各数据库系统独有函数
    其他函数
    日期时间函数
    字符串函数
  • 原文地址:https://www.cnblogs.com/staryea/p/8514144.html
Copyright © 2011-2022 走看看