Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Typical configure options for MYSQL (turn)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

MYSQL's typical configure option [@ more@] configure script gives you a lot of control over how to configure your MySQL distribution. Typically, you use the options on the configure command line. You can also use the correct environment variables to act on configure. For a selection list supported by configure, run this command:

Shell >. / configure-- help

Some of the more common configure options are described below:

* compile only the MySQL client library and client programs, not the server, using the-- without-server option:

Shell >. / configure-- without-server

If you do not have a C++ compiler, mysql will not compile (there is a client program that needs C++). In this case, you can remove the code from configure that tests the C++ compiler and run. / configure with the-- without-server option. The compilation step will still try to construct mysql, but you can ignore any warnings about "mysql.cc". If make stops, try make-k and tell it to continue with the rest of the construction steps even if something goes wrong.

* if you do not want log files and databases located in the "/ usr/local/var" directory, use one similar to the following configure command:

Shell >. / configure--prefix=/usr/local/mysql

Shell >. / configure--prefix=/usr/local-- localstatedir=/usr/local/mysql/data

The first command changes the installation prefix so that anything is installed under "/ usr/local/mysql" instead of the default "/ usr/local". The second command retains the default installation prefix, but overwrites the database directory default directory (usually "/ usr/local/var") and changes it to / usr/local/mysql/data.

* if you are using Unix and you want the socket for MySQL to be located somewhere outside the default location (usually in the directory "/ tmp" or "/ var/run", use the configure command like this:

Shell >. / configure-- with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock

Note that the file given must be an absolute path!

* if you want to compile a static linker (for example, make a binary distribution, get faster, or solve some of the distribution with RedHat), run configure like this:

Shell >. / configure-with-client-ldflags=-all-static-with-mysqld-ldflags=-all-static

* if you are using gcc and do not have libg++ or libstdc++, installed, you can tell configure to use gcc as the C++ compiler:

Shell > CC=gcc CXX=gcc. / configure

When you use gcc as a C++ compiler, it will not attempt to link to libg++ or libstdc++. If the construction fails and there is an error about the compiler or linker, the shared library "libmysqlclient.so.#" ("#" is a version number) cannot be created. You can solve this problem by specifying the-- disable-shared option for configure. In this case, configure will not construct a shared libmysqlclient.so.# library.

* you can set MySQL not to use DEFAULT column values for non-NULL columns (that is, columns are not allowed to be NULL). This causes an error in the INSERT statement unless you explicitly specify a value for all columns that require a non-null value. To disable the default values, run configure like this:

Shell > CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS. / configure

* by default, MySQL uses the ISO-8859-1 (Latin1) character set. To change the default settings, use-- with-charset to select the project:

Shell >. / configure-- with-charset=CHARSET

CHARSET can be one of big5, cp1251, cp1257, czech, danish, dec8, dos, euc_kr, gb2312 gbk, german1, hebrew, hp8, hungarian, koi8_ru, koi8_ukr, latin1, latin2, sjis, swe7, tis620, ujis, usa7, win1251 or win1251ukr. See 9.1.1 character sets for data and sorting. Note: if you want to change the character set, you must do make distclean during configuration! If you want to convert characters between server and client, you should take a look at the SET OPTION CHARACTER SET command. See 7.25 SET OPTION syntax. Warning: if you change the character set after creating any database tables, you will have to run myisamchk-r-Q on each table, otherwise your index may be sorted incorrectly. This can happen if you install MySQL, create some tables, then reconfigure MySQL to use a different character set and reinstall it. )

* to configure MySQL with debug code, use the-- with-debug option:

Shell >. / configure-- with-debug

This results in the inclusion of a secure memory allocator that can find some errors and provide output about what is happening. See G.1 to debug a MySQL server.

* options that belong to a specific system can be found in the specific system section of this chapter. See 4.11 system-specific issues.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report