Home >Database >Mysql Tutorial >How to configure mysql environment variables
How to configure MySQL environment variables? Find the MySQL installation path (such as C:\Program Files\MySQL\MySQL Server 8.0 in Windows). Configure the PATH variable and add the MySQL bin folder path. Configure the MYHOME and MYSQL_HOME variables to specify the MySQL installation path respectively. Test the environment variable configuration and enter mysql --version in the terminal to check whether the output is correct.
Configure MySQL environment variables
In order to use MySQL in the system, you need to configure the environment variables to specify the installation of MySQL path and other necessary information. Here's how to configure MySQL environment variables:
1. Find the MySQL installation path
C:\Program Files\ MySQL\MySQL Server 8.0
. /usr/local/mysql
. 2. Configure PATH
Windows:
C:\Program Files\MySQL\MySQL Server 8.0\bin
). macOS and Linux:
Enter the following command in a terminal window:
<code>export PATH=$PATH:~/mysql/bin</code>
3. Configure MYHOME
##Windows:
in the "Variable Name" field, and enter the MySQL installation path in the "Variable Value" field (such as
C:\Program Files\MySQL\MySQL Server 8.0).
macOS and Linux:
<code>export MYHOME=~/mysql</code>
In In the Environment Variables window, click New.
).
##Enter the following command:
<code>export MYSQL_HOME=~/mysql</code>
Enter mysql --version
in the terminal window.
The above is the detailed content of How to configure mysql environment variables. For more information, please follow other related articles on the PHP Chinese website!