转载自:https://dev.mysql.com/doc/internals/en/guided-tour-majordir-build.html
The first major directory we'll look at is BUILD. It actually has very little in it, but it's useful, because one of the first things you might want to do with the source code is: compile and link it.
The example command line that we could use is
shell> ./BUILD/compile-pentium-debug --prefix=$HOME/mysql-bin
It invokes a batch file in the BUILD
directory. When it's done, you'll have an executable MySQL server and client.
Or, um, well, maybe you won't. Sometimes people have trouble with this step because there's something missing in their operating system version, or whatever. Don't worry, it really does work, and there are people around who might help you if you have trouble with this step. Search for "build" in the archives of lists.mysql.com.
We, when we're done building, tend to install it with the following sequence:
shell>make
shell>make install
shell>$HOME/mysql-bin/scripts/mysql_install_db \ --basedir=$HOME/mysql-bin \ --datadir=$HOME/mysql-bin/var
This puts the new MySQL installation files on
shell>$HOME/mysql-bin/bin -- for the server
shell>$HOME/mysql-bin/bin -- for the mysql client
shell>$HOME/mysql-bin/var -- for the databases
Before MySQL 5.5, mysql_install_db is located in the bin
directory and the server is located in the libexec
directory.