zoukankan      html  css  js  c++  java
  • mysql二进制安装

    二进制包

    https://dev.mysql.com/downloads/mysql/

    把包上传到服务器上

    [root@web01 tools]# ls
    mysql-5.5.59-linux-glibc2.12-x86_64.tar.gz

    创建用户

    useradd mysql -s /sbin/nologin -M

    解压缩mysql包

    tar xf mysql-5.5.59-linux-glibc2.12-x86_64.tar.gz 

    移动到软件包目录

     mv mysql-5.5.59-linux-glibc2.12-x86_64 /application/mysql-5.5.59

    创建软连接

    ln -s /application/mysql-5.5.59/ /application/mysql

    授权

    cd /application/mysql/

    chown -R mysql.mysql /application/mysql/

    初始化

    ./scripts/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql

     --basedir=/application/mysql/   初始化文件目录

     --datadir=/application/mysql/data/  数据存放的目录

    --user=mysql  指定用户

    二进制安装,启动mysqld_safe脚本文件默认路径都是/usr/local/路径,需要更该

    sed  -i 's#/usr/local#/application/mysql#g' mysqld_safe 

    拷贝启动文件

     cp my-small.cnf /etc/my.cnf

    现在就可以启动mysql了

    /application/mysql/bin/mysqld_safe --user=mysql & 

    查看端口

    lsof -i:3306

    进入mysql

    /application/mysql/bin/mysql
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 1
    Server version: 5.5.59 MySQL Community Server (GPL)

    Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

    mysql>

    修改环境变量  输入mysql直接可以进来

    vim /etc/profile

    PATH="/application/mysql/bin:$PATH"

    . /etc/profile

    修改启动脚本,可以使用/etc/init.d/mysql start方式启动

    cd /application/mysql/support-files

    sed  -i 's#/usr/local#/application/mysql#g' mysql.server

    cp mysql.server /etc/init.d/mysqld

    chmod +x /etc/init.d/mysqld

    /etc/init.d/mysqld stop

    修改密码

     mysqladmin  -uroot password 123456

  • 相关阅读:
    cocos2d 中判断CGPoint或者CGSize是否相等
    object-c cocos2d-x 写程序时注意调试的技巧
    object-c [self class] 和 [self _cmd]
    object-c 协议和委托
    ios cocos2d TexturePacker生成文件后的使用方法
    object-c 要理解协议的几个重要概念
    Linux Mint 没有 language support 语言支持解决方案
    cocos2d ARCH_OPTIMAL_PARTICLE_SYSTEM这个未定义的问题
    CCSpriteBatchNode的优化性能
    Codeforces Round #190 DIV.2 A. Ciel and Dancing
  • 原文地址:https://www.cnblogs.com/sky00747/p/8392298.html
Copyright © 2011-2022 走看看