MySQL my.cnf file - Found option without preceding group

后端 未结 5 554
轻奢々
轻奢々 2020-12-02 15:29

I\'m trying to connect to my DB in Ubuntu remotely but I receive error message when trying to mysql -u root -p:

Found option without prec

5条回答
  •  天命终不由人
    2020-12-02 15:54

    I had this problem when I installed MySQL 8.0.15 with the community installer. The my.ini file that came with the installer did not work correctly after it had been edited. I did a full manual install by downloading that zip folder. I was able to create my own my.ini file containing only the parameters that I was concerned about and it worked.

    1. download zip file from MySQL website
    2. unpack the folder into C:\program files\MySQL\MySQL8.0
    3. within the MySQL8.0 folder that you unpacked the zip folder into, create a text file and save it as my.ini
    4. include the parameters in that my.ini file that you are concerned about. so something like this(just ensure that there is already a folder created for the datadir or else initialization won't work):

      [mysqld]
      basedire=C:\program files\MySQL\MySQL8.0
      datadir=D:\MySQL\Data
      ....continue with whatever parameters you want to include
      
    5. initialize the data directory by running these two commands in the command prompt:

      cd C:\program files\MySQL\MySQL8.0\bin
      mysqld --default-file=C:\program files\MySQL\MySQL8.0\my.ini --initialize
      
    6. install the MySQL server as a service by running these two commands:

      cd C:\program files\MySQL\MySQL8.0\bin
      mysqld --install --default-file=C:\program files\MySQL\MySQL8.0\my.ini
      
    7. finally, start the server for the first time by running these two commands:

      cd C:\program files\MySQL\MySQL8.0\bin
      mysqld --console
      

提交回复
热议问题