Prior to endeavoring to run MariaDB, first decide its present status, running or closure. There are three choices for beginning and halting MariaDB −
- Run mysqld (the MariaDB twofold).
- Run the mysqld_safe startup content.
- Run the mysql.server startup content.
On the off chance that you introduced MariaDB in a non-standard area, you may need to alter area data in the content documents. Stop MariaDB by basically adding a "stop" boundary with the content.
On the off chance that you might want to begin it naturally under Linux, add startup contents to your init framework. Every circulation has an alternate methodology. Allude to your framework documentation.
Creating a User Account
Make another client account with the accompanying code −
CREATE USER 'newusername'@'localhost' IDENTIFIED BY 'userpassword';
This code adds a line to the client table without any advantages. You likewise have the choice to utilize a hash an incentive for the secret word. Award the client advantages with the accompanying code −
GRANT SELECT, INSERT, UPDATE, DELETE ON database1 TO 'newusername'@'localhost';
Different advantages remember pretty much every order or activity workable for MariaDB. Subsequent to making a client, execute a "FLUSH PRIVILEGES" order to revive award tables. This permits the client record to be utilized.
The Configuration File
After an expand on Unix/Linux, the design document "/and so forth/mysql/my.cnf" ought to be altered to show up as follow −
# 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
temp-pool
# The following three entries caused mysqld 10.0.1-MariaDB (and possibly other
versions) to abort...
# skip-locking
# 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
MariaDB
8
set-variable = max_allowed_packet=16M
[mysql]
no-auto-rehash
[myisamchk]
set-variable = key_buffer = 128M
Alter the lines "data= " and "language= " to coordinate your current circumstance.
After record change, explore to the source catalog and execute the accompanying −
./scripts/mysql_install_db --srcdir = $PWD --datadir = /path/to/data/dir --
user = $LOGNAME
Discard the "$PWD" variable in the event that you added datadir to the arrangement record. Guarantee "$LOGNAME" is utilized when running rendition 10.0.1 of MariaDB.
Administration Commands
Survey the accompanying rundown of significant orders you will consistently utilize when working with MariaDB −
- USE [database name] − Sets the current default information base.
- SHOW DATABASES − Lists the data sets presently on the worker.
- SHOW TABLES − Lists all non-impermanent tables.
- SHOW COLUMNS FROM [table name] − Provides section data relating to the predefined table.
- SHOW INDEX FROM TABLENAME [table name] − Provides table list data identifying with the predetermined table.
- SHOW TABLE STATUS LIKE [table name]\G – − Provides tables with data about non-impermanent tables, and the example that shows up after the LIKE condition is utilized to get table names.