Precautions for installing and using MySQL on linux or unix servers

  • 2020-05-12 06:22:08
  • OfStack

1. How to get the latest version of MySQL?

To install MySQL, you should, of course, get the latest version of MySQL. Although you know that MySQL can be found in Packages of FreeBSD, I recommend you look for the latest version of MySQL on the web. I introduce you to http: / / www mysql. org to download, here is the latest version of the MySQL versions 3.23.

2. What should I pay attention to when installing MySQL?

1, if you are using MySQL+Apache, FreeBSD network operating system, you should pay attention to the version of FreeBSD, MySQL Source MIT-pthread version of FreeBSD 3.0 below, MySQL Source MySQL Source MIT-pthread operating is normal, but above this version, you must use native threads, that is to add a with-named-thread-libs = -lc_r option.

2. If you have a problem with COMPILE, please check whether your gcc version is above 2.81 and gmake version is above 3.75.

3. If it's not a version issue, you may be out of memory, so use./configure -- with-low-memory.

4. If you want to redo your configure, you can clear the record by typing rm config.cache and make clean.

5. We usually install MySQL in the /usr/local directory, which is the default value. You can also set the directory you install according to your needs.

3. Start and stop MySQL

If you have never installed MySQL on your machine, the last command you type when installing MySQL is /usr/local/ mysql-3.23 X/scripts/mysql_install_db

If you are installing multiple machines at the same time, you can edit the file 1 so that you can easily set the permissions for each machine.

1, in the installation directory/usr/local start mysql can use/usr local share/mysql/mysql server start. Remember the mysql server attribute is set to 777

2, to stop mysql daemon can use/usr local bin/mysqladmin shutdown to implement

3. If you have a password for mysql, you must use mysqladmin-u root-p shutdown

4. Build a user of MYSQL using root

You need to login with root machine first, and then change directory access permissions chown - R mysql/usr/local/var, then modify mysql. server file, the file is located in/usr/local/share mysql /, Change mysql_daemon_user=root to mysql_daemon_user=mysql.

But after the new database in the future, remember to bring your relevant file access permissions to change the past: chown - R mysql usr/local/var/some_new_dbs

If you want your computer to start up automatically loaded mysql, you as long as in the/et c. local add 1 row/usr local/mysql/share server start

Related articles: