ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • ubuntu(우분투)에 mysql5.5.62 설치하기
    개발관련/설치 및 세팅 2020. 2. 23. 19:02

     


    서버 : NCP(네이버클라우드플랫폼) - micro

    OS : ubuntu-16.04-64-server

     

     

    1. 다운로드

    wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz

    2.  Add mysql user group

    sudo groupadd mysql

    3. Add mysql (not the current user) to mysql user group

    sudo useradd -g mysql mysql

    4. Extract it

    sudo tar -xvf mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz

    5. Move it to /usr/local

    sudo mv mysql-5.5.62-linux-glibc2.12-x86_64 /usr/local/

    6. Create mysql folder in /usr/local by moving the untarred folder

    cd /usr/local
    sudo mv mysql-5.5.62-linux-glibc2.12-x86_64 mysql

    7. set MySql directory owner and user group

    cd mysql
    sudo chown -R mysql:mysql *

    8. Install the required lib package

    sudo apt-get install libaio1

    9. Execute mysql installation script

    sudo scripts/mysql_install_db --user=mysql

    10. Set mysql directory owner from outside the mysql directory

    sudo chown -R root .

    11. Set data directory owner from inside mysql directory

    sudo chown -R mysql data

    12. Copy the mysql configuration file

    sudo cp support-files/my-medium.cnf /etc/my.cnf

    13. Start mysql

    sudo bin/mysqld_safe --user=mysql &
    sudo cp support-files/mysql.server /etc/init.d/mysql.server

    14. Set root user password

    sudo bin/mysqladmin -u root password '[원하는 비밀번호]'

    15. Add mysql path to the system

    sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

    16. 우분투 서버  재부팅

    sudo reboot now

    17. Start mysql server

    sudo /etc/init.d/mysql.server start

    18. Stop mysql server

    sudo /etc/init.d/mysql.server stop

    19. Check status of mysql

    sudo /etc/init.d/mysql.server status

    20.  Enable myql on startup (자동실행)

    sudo update-rc.d -f mysql.server defaults

    21. Disable mysql on startup (자동실행 취소)

    (안해도됨)

    sudo update-rc.d -f mysql.server remove

    그 외 

     

    1. 비밀번호 변경 방법

    --root로 접속
    use mysql;
    update user set authentication_string=password('바꿀비번') where user='root';
    flush privileges;
    quit

     

    2. 설치 경로

    /usr/local/mysql/

Designed by Tistory.