MySQL installation tutorial and precautions

Source: Internet
Author: User
Tags natural log

1. How to obtain the 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.

Ii. What should I do when 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 you must use

Native threads, that is, to 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.

5. Test your mysql

After mysql is started, you can use ps-aux for testing, and you will find that two more process MYSQL syntaxes are used.

String type --- STRINGS

String Matching must be paired, for example:

'My IS opps'

"My is ocpiscai"

They must be expressed in ''or!

Here are some examples that contain single quotes and double quotes in strings, for example:

Duplicate double quotation marks:

Mysql> select "hi! "Ocp" "!"

-> Hi !" Ocp "!

Because our HTML network contains many single quotes and double quotes, the program

Here, you may encounter problems caused by single quotes and double quotation marks, so be careful.

Number Type --- NUMBERS

Let's look at some valid digital expressions:

7

777

-777

77.77

77.777

-777.7777o + 7

For database naming problems, the naming principles of TATBLE, INDEX, COLUMN, and alias name can be used as the beginning, bottom line, but not digits. Avoid using the $ character as much as possible. In MYSQL, the $ character is completely legal, but it will be confused with PHP, so it is best not to use it. The name cannot contain the "." character. Alias name can contain 256 characters, and other characters are generally within 60 characters. You can modify the length of MYSQL_INSTALL_DB according to your needs. When you change the length, be sure not to overwrite it. the MYSQL database is supported, however, I have not tried the core of MYSQL and may encounter errors.

Numeric function: When a numeric function fails, all return values are NULL.

LOG10 (X): The base-10 LOG value.

Mysql> select log (EXP (1 ));

-> 2.000000

EXP (X): returns the X power of E, where E is the base number of natural log.

FLOOR (X): returns the largest integer less than or equal to X.

CEILING (X): returns the smallest integer of X with heavy rain.

ROUND (X): returns a rounded integer.

MOD (N, M) or %: Divide N by the remainder of M.

SIGN (X): X is greater than 1, X is equal to 0, and X is less than 0.

ABS (X): returns the absolute value.

ROUND (X, D): ROUND to D decimal places. D equals 0 and is the same as ROUND (X.

Trigonometric function:

ATAN (X, Y): inverse trigonometric function

ATAN2 (X, Y): inverse trigonometric function

LEAST (X, Y ,...) : Returns the minimum value of at least two parameters.

GREATEST (X, Y ,...) : Returns the maximum value of at least two parameters.

DEGREES (X): converts radians (RADIAN) to DEGREES.

RADIANS (X): converts degrees to RADIANS.

Related Article

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.