Blame


1 aa513bf8 2023-01-22 jrmu version=pmwiki-2.2.130 ordered=1 urlencoded=1
2 aa513bf8 2023-01-22 jrmu agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 OPR/78.0.4093.147
3 aa513bf8 2023-01-22 jrmu author=wiz
4 aa513bf8 2023-01-22 jrmu charset=UTF-8
5 aa513bf8 2023-01-22 jrmu csum=
6 aa513bf8 2023-01-22 jrmu ctime=1629735628
7 aa513bf8 2023-01-22 jrmu host=77.100.13.190
8 aa513bf8 2023-01-22 jrmu name=Mariadb.Install
9 aa513bf8 2023-01-22 jrmu rev=4
10 aa513bf8 2023-01-22 jrmu targets=
11 aa513bf8 2023-01-22 jrmu text=!!Mariadb Installation and Basic commands%0a%0aMariaDB is a replacement for Oracle MySQL servers. It is a multithreaded SQL database with a command syntax very similar to mSQL. This page shows how to install MariaDB server on OpenBSD.%0a%0a!!!There are two packages%0a#mariadb-server – The MariaDB server.%0a#mariadb-client – The client side of MariaDB server including mysqlclient library and headers for the MariaDB client API.%0a%0a%0aWe will only install and mariadb-server%0a[@%0a$ doas pkg_add curl%0a$ doas pkg_add mariabd-server%0a@]%0acurl is a one of the dependency package for mariadb-server.%0a%0aNow we need to configure mariadb to run.%0a%0aopen open '''/etc/my.cnf''' with your regular editor%0a[@%0a$ vi open /etc/my.cnf%0a@]%0a%0aUncommnet the bold lines %0a%0a%0a[client-server]%0a%0a'''socket=/var/run/mysql/mysql.sock'''%0a%0achange the above line to %0a%0a'''socket=/var/www/var/run/mysql/mysql.sock'''%0a%0a'''port=3306'''%0a%0a'''bind-address=0.0.0.0'''%0a%0a'''data=/var/mysql'''%0a%0asave%0a%0aRun the following command %0a%0a[@%0a$ mysql_install_db%0a@]%0a%0a!!!Initialize MariaDB data directory%0aThe above command is for initialising You need to run mysql_install_db command. It initialises the MariaDB data directory and creates the system tables:%0a%0a[@%0a$ mysql_install_db%0a@]%0a%0aNow start mariadb%0a%0a[@%0a$ doas rcctl enable mysqld%0a$ doas rcctl start mysqld%0amysqld(ok)%0a@]%0a%0aTo check if you mariadb is running run following command%0a%0a[@%0a$ ps -aux | grep mysqld%0a@]%0a%0ayou will see a line pops up as follow:%0a%0a[@%0aroot 94120 0.0 0.2 1016 1040 p0 Sp 10:40AM 0:00.02 /bin/sh /usr/local/bin/mysqld_safe%0a@]%0a%0a'''We are good to go..its running'''%0a%0a!!Mariadb database creation and user privileges commands %0a%0a%0aTo connect to mariadb console%0a[@%0a$ mysql -u root -p%0a@]%0a%0aCreate a new database:%0a%0a[@%0aMariaDB> create database DATABASE_NAME;%0a@]%0a%0aCreate a new user (only with local access) and grant privileges to this user on the new database:%0a%0a[@%0aMariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD';%0a@]%0a%0aCreate a new user (with remote access) and grant privileges to this user%0aon the new database:%0a%0a[@%0aMariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%25' identified by 'PASSWORD';%0a@]%0a%0aAfter modifying the MariaDB grant tables, execute the following command in order to apply the changes:%0a%0a[@%0aMariaDB> flush privileges;%0a@]%0a%0aother command to add user : %0a[@%0aCREATE USER 'user1'@localhost IDENTIFIED BY 'password1'; database list: SHOW DATABASES; grant access : GRANT ALL PRIVILEGES ON 'yourDB'.* TO 'user1'@localhost;%0a@]%0a%0a{-No ''Error'' Happy days-} =)
12 aa513bf8 2023-01-22 jrmu time=1629736976
13 aa513bf8 2023-01-22 jrmu author:1629736976=wiz
14 aa513bf8 2023-01-22 jrmu diff:1629736976:1629736823:=111,114c111,112%0a%3c other command to add user : %0a%3c [@%0a%3c CREATE USER 'user1'@localhost IDENTIFIED BY 'password1'; database list: SHOW DATABASES; grant access : GRANT ALL PRIVILEGES ON 'yourDB'.* TO 'user1'@localhost;%0a%3c @]%0a---%0a> other commands add user : CREATE USER 'user1'@localhost IDENTIFIED BY 'password1'; database list: SHOW DATABASES; grant access : GRANT ALL PRIVILEGES ON 'yourDB'.* TO 'user1'@localhost;%0a> %0a
15 aa513bf8 2023-01-22 jrmu host:1629736976=77.100.13.190
16 aa513bf8 2023-01-22 jrmu author:1629736823=mkf
17 aa513bf8 2023-01-22 jrmu csum:1629736823="small update"
18 aa513bf8 2023-01-22 jrmu diff:1629736823:1629735673:=11,14c11,14%0a%3c [@%0a%3c $ doas pkg_add curl%0a%3c $ doas pkg_add mariabd-server%0a%3c @]%0a---%0a> %0a> $doas pkg_add curl%0a> $doas pkg_add mariabd-server%0a> %0a20,23c20,22%0a%3c [@%0a%3c $ vi open /etc/my.cnf%0a%3c @]%0a%3c %0a---%0a> %0a> $vi open /etc/my.cnf%0a> %0a45,48c44,45%0a%3c [@%0a%3c $ mysql_install_db%0a%3c @]%0a%3c %0a---%0a> $mysql_install_db%0a> %0a52,55c49,51%0a%3c [@%0a%3c $ mysql_install_db%0a%3c @]%0a%3c %0a---%0a> $mysql_install_db%0a> %0a> %0a58,63c54,60%0a%3c [@%0a%3c $ doas rcctl enable mysqld%0a%3c $ doas rcctl start mysqld%0a%3c mysqld(ok)%0a%3c @]%0a%3c %0a---%0a> $rcctl enable mysqld\\%0a> %0a> $rcctl start mysqld\\%0a> %0a> mysqld(ok)\\%0a> %0a> %0a66,75c63,68%0a%3c [@%0a%3c $ ps -aux | grep mysqld%0a%3c @]%0a%3c %0a%3c you will see a line pops up as follow:%0a%3c %0a%3c [@%0a%3c root 94120 0.0 0.2 1016 1040 p0 Sp 10:40AM 0:00.02 /bin/sh /usr/local/bin/mysqld_safe%0a%3c @]%0a%3c %0a---%0a> $ps -aux | grep mysqld%0a> %0a> you will see a line pops up as follow. %0a> %0a> '''root 94120 0.0 0.2 1016 1040 p0 Sp 10:40AM 0:00.02 /bin/sh /usr/local/bin/mysqld_safe'''%0a> %0a82,85c75,77%0a%3c [@%0a%3c $ mysql -u root -p%0a%3c @]%0a%3c %0a---%0a> %0a> $mysql -u root -p%0a> %0a87,88d78%0a%3c %0a%3c [@%0a90,94c80,82%0a%3c @]%0a%3c %0a%3c Create a new user (only with local access) and grant privileges to this user on the new database:%0a%3c %0a%3c [@%0a---%0a> %0a> Create a new user (only with local access) and grant privileges to this%0a> user on the new database:%0a96,97c84%0a%3c @]%0a%3c %0a---%0a> %0a100,101d86%0a%3c %0a%3c [@%0a103,107c88,90%0a%3c @]%0a%3c %0a%3c After modifying the MariaDB grant tables, execute the following command in order to apply the changes:%0a%3c %0a%3c [@%0a---%0a> %0a> After modifying the MariaDB grant tables, execute the following command in%0a> order to apply the changes:%0a109d91%0a%3c @]%0a
19 aa513bf8 2023-01-22 jrmu host:1629736823=198.251.81.133
20 aa513bf8 2023-01-22 jrmu author:1629735673=wiz
21 aa513bf8 2023-01-22 jrmu diff:1629735673:1629735628:=69c69%0a%3c '''We are good to go..its running'''%0a---%0a> !!!We are good to go..its running%0a
22 aa513bf8 2023-01-22 jrmu host:1629735673=77.100.13.190
23 aa513bf8 2023-01-22 jrmu author:1629735628=wiz
24 aa513bf8 2023-01-22 jrmu diff:1629735628:1629735628:=1,96d0%0a%3c !!Mariadb Installation and Basic commands%0a%3c %0a%3c MariaDB is a replacement for Oracle MySQL servers. It is a multithreaded SQL database with a command syntax very similar to mSQL. This page shows how to install MariaDB server on OpenBSD.%0a%3c %0a%3c !!!There are two packages%0a%3c #mariadb-server – The MariaDB server.%0a%3c #mariadb-client – The client side of MariaDB server including mysqlclient library and headers for the MariaDB client API.%0a%3c %0a%3c %0a%3c We will only install and mariadb-server%0a%3c %0a%3c $doas pkg_add curl%0a%3c $doas pkg_add mariabd-server%0a%3c %0a%3c curl is a one of the dependency package for mariadb-server.%0a%3c %0a%3c Now we need to configure mariadb to run.%0a%3c %0a%3c open open '''/etc/my.cnf''' with your regular editor%0a%3c %0a%3c $vi open /etc/my.cnf%0a%3c %0a%3c Uncommnet the bold lines %0a%3c %0a%3c %0a%3c [client-server]%0a%3c %0a%3c '''socket=/var/run/mysql/mysql.sock'''%0a%3c %0a%3c change the above line to %0a%3c %0a%3c '''socket=/var/www/var/run/mysql/mysql.sock'''%0a%3c %0a%3c '''port=3306'''%0a%3c %0a%3c '''bind-address=0.0.0.0'''%0a%3c %0a%3c '''data=/var/mysql'''%0a%3c %0a%3c save%0a%3c %0a%3c Run the following command %0a%3c %0a%3c $mysql_install_db%0a%3c %0a%3c !!!Initialize MariaDB data directory%0a%3c The above command is for initialising You need to run mysql_install_db command. It initialises the MariaDB data directory and creates the system tables:%0a%3c %0a%3c $mysql_install_db%0a%3c %0a%3c %0a%3c Now start mariadb%0a%3c %0a%3c $rcctl enable mysqld\\%0a%3c %0a%3c $rcctl start mysqld\\%0a%3c %0a%3c mysqld(ok)\\%0a%3c %0a%3c %0a%3c To check if you mariadb is running run following command%0a%3c %0a%3c $ps -aux | grep mysqld%0a%3c %0a%3c you will see a line pops up as follow. %0a%3c %0a%3c '''root 94120 0.0 0.2 1016 1040 p0 Sp 10:40AM 0:00.02 /bin/sh /usr/local/bin/mysqld_safe'''%0a%3c %0a%3c !!!We are good to go..its running%0a%3c %0a%3c !!Mariadb database creation and user privileges commands %0a%3c %0a%3c %0a%3c To connect to mariadb console%0a%3c %0a%3c $mysql -u root -p%0a%3c %0a%3c Create a new database:%0a%3c MariaDB> create database DATABASE_NAME;%0a%3c %0a%3c Create a new user (only with local access) and grant privileges to this%0a%3c user on the new database:%0a%3c MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD';%0a%3c %0a%3c Create a new user (with remote access) and grant privileges to this user%0a%3c on the new database:%0a%3c MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%25' identified by 'PASSWORD';%0a%3c %0a%3c After modifying the MariaDB grant tables, execute the following command in%0a%3c order to apply the changes:%0a%3c MariaDB> flush privileges;%0a%3c %0a%3c other commands add user : CREATE USER 'user1'@localhost IDENTIFIED BY 'password1'; database list: SHOW DATABASES; grant access : GRANT ALL PRIVILEGES ON 'yourDB'.* TO 'user1'@localhost;%0a%3c %0a%3c %0a%3c {-No ''Error'' Happy days-} =)%0a\ No newline at end of file%0a
25 aa513bf8 2023-01-22 jrmu host:1629735628=77.100.13.190