Precautions for installing and using MySQL on the server _ MySQL

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.