ERROR 1064 42000 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near mysql_install_db --user=root at line 1
This error is occurring because you are trying to execute a command in the MariaDB shell that is not valid SQL syntax.
The command 'mysql_install_db --user=root' is a command-line command that is used to initialize the MySQL/MariaDB data directory and create the system tables needed by the database.
To execute this command, you should exit the MariaDB shell and run it from the command-line interface (CLI) of your operating system.
For example, if you are using Linux, you can execute the command by opening a terminal and typing:
sudo mysql_install_db --user=root
This will initialize the data directory and create the system tables for MariaDB.
After that, you can start the MariaDB server and connect to it using the command:
sudo systemctl start mariadb
mysql -u root -p
This will start the MariaDB server and open the MariaDB shell, where you can interact with the database using valid SQL syntax
原文地址: http://www.cveoy.top/t/topic/cghV 著作权归作者所有。请勿转载和采集!