Precautions for installing and using MySQL on the server 1. Latest MySQL version
To install MySQL, you must first obtain the latest version of MySQL. although we all know that MySQL can be found in FreeBSD Packages, I suggest you go to the network to find the latest version of MySQL. Introduction to the http://www.mysql.org to download, the latest version here is MySQL 3.23 versions.
II. precautions for installing MySQL
1. if you are using MySQL + Apache and the FreeBSD network operating system, you should pay attention to the FreeBSD version during installation. in FreeBSD versions earlier than 3.0, the MIT-pthread contained in MySQL Source runs normally, but in this version or later, you must use native threads, that is, add an option with-named-thread-libs =-lc_r.
2. if a problem occurs during the COMPILE process, check whether your gcc version is later than 2.81 and gmake version is later than 3.75.
3. if it is not a version issue, it may be that your memory is insufficient. use./configure -- with-low-memory to add it.
4. if you want to re-configure your configure, you can type rm config. cache and make clean to clear the record.
5. we usually install MySQL in the/usr/local directory. this is the default value. you can also set the directory you want to install.
III. start and stop MySQL
If you have never installed MySQL on your machine, the last command you typed when installing MySQL is/usr/local/mysql-3.23X/scripts/mysql_install_db
If you install multiple machines at the same time, you can edit the file so that you can easily set permissions for each machine.
1. in the installation directory/usr/local to start mysql, you can use/usr/local/share/mysql. server start to remember to set the attribute of mysql. server to 777.
2. you can use/usr/local/bin/mysqladmin shutdown to stop mysql daemon.
3. if you have set a password for mysql, you must use mysqladmin-u root-p shutdown.
4. use root to create a MYSQL User
You need to log on to the machine with the root user, change the directory access permission chown-R mysql/usr/local/var, and then modify mysql. server File. the file is located under/usr/local/share/mysql/. change mysql_daemon_user = root to mysql_daemon_user = mysql.
However, after adding a database, remember to change your file access permission to chown-R mysql/usr/local/var/some_new_dbs.
If you want your computer to automatically load mysql at startup, you only need to add a/usr/local/mysql/share. server start line in/etc/rc. local.