Home  >  Q&A  >  body text

linux - How to install mysql on Alibaba Cloud ecs

Such as the title: How to build a mysql environment on Alibaba Cloud server ecs by yourself. If you use npm install (node ​​is installed), how to modify the mysql configuration file

Always report an error

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I tried many online solutions, such as adding skip-grant-tables to skip entering the password, but my mysql restart is not easy to use

[root@iZ2ze6yh0lvendgbwk6k4tZ ~]# service mysqld restart
Stopping mysqld:  [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:  [FAILED]

Server novice please give me some advice

滿天的星座滿天的星座2713 days ago576

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:20:25

    Install mysql

    • yum installation

    • Binary package installation

    • Compile and install

    mysql startup error

    • Start the error report and look at the error log of mysql

    • Login permission error, skip-grant-tables After skipping, change the mysql user password

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:20:25

    Solved, my problem:

    • skip grunt tables 放错位置了 我放在[mysqld_safe]的块下面了 放在[mysqld]That’s it

    • The next restart failed. Looking at the error log, 3306 was occupied. kill -9 [pid] 发现杀掉后立刻重启,我用kill [pid]Kill directly and found that the 3306 port was not occupied

    • Next, connect to mysql. The error message is that there is no mysql.sock file. Maybe I deleted it by mistake before. I restarted the server and then service mysqld restart 重启,找到了mysql.sock ,之后发现my.cnf 文件下的socket位置与它找的不一样,用ln -s soft-connected it

    Finally successful~

    reply
    0
  • Cancelreply