Home  >  Q&A  >  body text

php - linux starts two mysql services at one time

Virtual machine environment: Port 192.168.0.140

        本地可以连接使用这个端口
        有密码
        使用navicat 工具可以进入mysql 服务

The virtual machine uses mysql -uroot -p
Entered the mysql service and found that the database connected above was not the same database! ,
And the password is empty
There is no mysql table inside either

So I suspected that two mysql services were installed
Then I found the data directory in phpstudy

Inside is the data I used to connect to the database using 192.168.0.140

What should I change so that mysql -uroot -p
also points to this directory, or do I need to move the data directory?

为情所困为情所困2590 days ago684

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-06-05 11:09:41

    Sir, the same port cannot be monitored at the same time. Since 2 MySQLs are installed on different machines at the same time, why do you have to omit the host when linking? If you really want to be lazy, I suggest you just write a shell

    Reply
    0
  • CancelReply