Escolar Documentos
Profissional Documentos
Cultura Documentos
Installing mysql can be a drudging experience, especially if you don't know where
to turn to ;) The mysql wiki does not always suit you with information, therefore
here I am to push you through the process.
The first problem I've encountered was not the compilation process (which is quite
straightforward) but chmoding and chowning the proper directories.
As you may have read somewhere, the var, tmp and data directories of mysql are
pretty important and the directory where you install mysql should be
distributed amongst only the proper users of a linux system.
The above is quite important while compiling mysql. I presume you abide to the tip
;]
After that, you have to prepare your directory. Let's say, that I've chosen
/home/me/mysql to be the root directory of mysql.
Okay, so now we have an empty tree of directories and a usergroup with one user in
it ;]. I've read somewhere that if use gcc instead of g++, you'll recieve lighter
binaries and less redundant bits. Didn't test that yet, but hey -
there's always room for improvement.
#!bash: cd /#MYSQL_SOURCE_DISTRIBUTION_DIRECTORY#/
#!bash: ./configure --prefix=/home/me/mysql --
localstatedir=/home/me/mysql/data --with-unix-socket-
path=/home/me/mysql/tmp/mysql.socket
The above does configure mysql so that you know where do you have your socket file
and you describe the data directory.
After running the command above, you wait for your makefile to generate. If you're
missing a dependency, just install it using your repo.
Now, we're ready to make the package. The files will appear in the mysql directory
tree we've built at line 26. (note 4 noobs - we're still in the mysql source
directory)
Grab a tea and sit back for a couple minutes. It takes time to compile the good
stuff ;)
#!bash: cd /home/me/mysql/bin
#!bash: ./mysql_install_db //This installs a database fileset into
/home/me/mysql/data - its the default directory, you can specify your own dir if
you look for it in --help.
#!bash: ./mysqld_safe -u root //You start your mysql daemon - this is
the moment that you start you database!
#!bash: ./mysqladmin -u root password #NEWPASSWORD# //Important: you set
your root password here!
#!bash: cd/home/me/mysq/bin
#!bash: ./mysql -u root -p //Logging in with the user root and a
password prompt!