Eseguire MariaDB dalla directory dei sorgenti

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

E' possibile eseguire mysqld direttamente dalla directory dei sorgenti (senza lanciare make install).

Avviare mysqld dopo il build su Windows

Su Windows, la directory dei dati viene creata durante il build.

Il modo più semplice per avviare il database dalla riga di comando è il seguente:

  1. Portarsi nella directory in cui si trova mysqld.exe (sottodirectory sql\Debug o sql\Relwithdebinfo della directory di build)
  2. Da qui, eseguire
    mysqld.exe --datadir=..\data --console
    

Come sempre, si possono passare altri argomenti a mysqld, oppure scriverli in un file di configurazione my.ini e passare --defaults-file=path\to\my.ini

Il percorso predefinito in cui Windows cerca il file my.cnf è:

  • GetSystemWindowsDirectory()
  • GetWindowsDirectory()
  • C:\
  • Directory in cui si trova l'eseguibile

Starting mysqld after build on Unix

Copy the following to your '~/.my.cnf' file.

There are two lines you have to edit: 'data=' and 'language='. Be sure to change them to match your environment.

# Example mysql config file.
# You can copy this to one of:
# /etc/my.cnf to set global options,
# /mysql-data-dir/my.cnf to get server specific options or
# ~/my.cnf for user specific options.
# 
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options

# This will be passed to all mysql clients
[client]
#password=my_password
#port=3306
#socket=/tmp/mysql.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# The MySQL server
[mysqld]
#port=3306
#socket=/tmp/mysql.sock
skip-locking
temp-pool
set-variable  = key_buffer=16M
set-variable  = thread_cache=4
loose-innodb_data_file_path = ibdata1:1000M
loose-mutex-deadlock-detector
gdb

######### Fix the two following paths

# Where you want to have your database
data=/path/to/data/dir

# Where you have your mysql/MariaDB source + sql/share/english
language=/path/to/src/dir/sql/share/english

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[mysql]
no-auto-rehash

[myisamchk]
set-variable= key_buffer=128M

With the above file in place, go to your MariaDB source directory and execute:

./scripts/mysql_install_db --srcdir=$PWD --datadir=/path/to/data/dir

Above '$PWD' is the environment variable that points to your current directory. If you added datadir to your my.cnf, you don't have to give this option above.

Now you can start mysqld in the debugger:

cd sql
ddd mysqld &

Or start mysqld on its own:

cd sql
./mysqld &

After starting up mysqld using one of the above methods (with the debugger or without), launch the client (as root if you don't have any users setup yet).

../client/mysql

Using a storage engine plugin

The simplest case is to compile the storage engine into MariadB:

configure --with-plugin-<plugin_name>

Another option is to point mysqld to the storage engine directory:

mysqld --plugin-dir=source-dir-path/storage/connect/.libs

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.