Main.WikiSandbox 13 KB

123456789101112131415161718192021222324252627282930313233
  1. version=pmwiki-2.2.130 ordered=1 urlencoded=1
  2. agent=Mozilla/5.0 (Windows NT 5.1; rv:68.0) Gecko/20100101 Goanna/4.8 Firefox/68.0 Mypal/29.3.0
  3. author=mkf
  4. charset=UTF-8
  5. csum=
  6. host=198.251.81.133
  7. name=Main.WikiSandbox
  8. rev=10
  9. targets=PmWiki.TextFormattingRules
  10. text=Feel free to use this page to experiment with the [[PmWiki/Text Formatting Rules]]. Just click the "Edit Page" link at the bottom of the page.%0a----%0a%0a!!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 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%0a{-No ''Error'' Happy days-} =)
  11. time=1629736749
  12. author:1629736749=mkf
  13. diff:1629736749:1626793013:=4,13c4,24%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---%0a> %0a> Test%0a> fdfdsfd%0a> %0a> (:title IRCNow: The Users' Network:)%0a> %0a> '''IRCNow''' provides internet services for the '''free and open source''' community. IRCNow is a [[freedom/federation|federation of servers]] to create a network that ensures [[freedom/freedom|user freedom]]. Learn about [[ircnow/goals|our goals]].%0a> %0a> To chat with us, you can connect to following servers%0a> ||border=1 width=50%25%0a> ||!Connection ||! Server ||! Port ||%0a> || IPv4 || [@irc.ircnow.org@] || 6667 or 6697 (SSL) || %0a> || IPv6 || [@ipv6.ircnow.org@] || 6667 or 6697 (SSL) ||%0a> || Tor || [@ircnowuj3luixmmz.onion@] || 6667 or 6697 (SSL) ||%0a> ([[ircnow/servers|Full list of servers]])%0a> %0a> ---%0a> chanop%0a> -----%0a> Setting ChanServ on your channels allow you to set modes and your rules to manage it, even after you got disconnected.%0a> first, join the channel you want to get chanserv on it. this usually done by%0a15,16c26%0a%3c $ doas pkg_add curl%0a%3c $ doas pkg_add mariabd-server%0a---%0a> /join #yourchannelname%0a18,22c28,30%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---%0a> if it didn't worked, check your client manual.%0a> %0a> then, check if that channel is not registered by someone else, by msg-ing chanserv info #yourchannelname%0a24c32%0a%3c $ vi open /etc/my.cnf%0a---%0a> /msg chanserv info #yourchannelname%0a26,47c34%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---%0a> if it has been taken by someone else, it will show something like this:%0a49c36,45%0a%3c $ mysql_install_db%0a---%0a> -ChanServ(services@services.irc.ircnow.org)- Information for channel #yourchannelname:%0a> -ChanServ(services@services.irc.ircnow.org)- Founder: mkf%0a> -ChanServ(services@services.irc.ircnow.org)- Description: yeah, that's my channel.%0a> -ChanServ(services@services.irc.ircnow.org)- Registered: Jul 20 06:34:21 2018 PDT (2 years ago)%0a> -ChanServ(services@services.irc.ircnow.org)- Last used: Jul 20 06:39:35 2022 PDT (now)%0a> -ChanServ(services@services.irc.ircnow.org)- Ban type: 2%0a> -ChanServ(services@services.irc.ircnow.org)- Mode lock: +nt%0a> -ChanServ(services@services.irc.ircnow.org)- Options: Peace, Security, Secure founder, Signed kicks, Topic retention%0a> -ChanServ(services@services.irc.ircnow.org)- Last topic: no, choose another name. this is my channel :^)%0a> -ChanServ(services@services.irc.ircnow.org)- Topic set by: mkf%0a52,54c48,49%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---%0a> it says this channel has taken by some guy with nick "mkf". in that case choose another name.%0a> if it has not taken by someone else, it should show something like that:%0a56c51%0a%3c $ mysql_install_db%0a---%0a> -ChanServ(services@services.irc.ircnow.org)- Channel #yourchannelname isn't registered.%0a58,60c53,54%0a%3c %0a%3c Now start mariadb%0a%3c %0a---%0a> in that case, you can take it. however, some networks doesn't allow some names for channels, ask admins of your network about that.%0a> for registering your channel into chanserv, do the following:%0a62,64c56%0a%3c $ doas rcctl enable mysqld%0a%3c $ doas rcctl start mysqld%0a%3c mysqld(ok)%0a---%0a> /msg chanserv register #yourchannelname this is my channel%0a66,117c58%0a%3c %0a%3c To check if you mariadb is running run following command%0a%3c %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%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 %0a%3c Create a new database:%0a%3c %0a%3c [@%0a%3c MariaDB> create database DATABASE_NAME;%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%3c MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'localhost' identified by 'PASSWORD';%0a%3c @]%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 %0a%3c [@%0a%3c MariaDB> grant all privileges on DATABASE_NAME.* TO 'USER_NAME'@'%25' identified by 'PASSWORD';%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%3c MariaDB> flush privileges;%0a%3c @]%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---%0a> it registers [@#yourchannelname@], under your current nick and with description "this is my channel"%0a
  14. host:1629736749=198.251.81.133
  15. author:1626793013=mkf
  16. diff:1626793013:1626789673:minor=54,59d53%0a%3c for registering your channel into chanserv, do the following:%0a%3c [@%0a%3c /msg chanserv register #yourchannelname this is my channel%0a%3c @]%0a%3c it registers [@#yourchannelname@], under your current nick and with description "this is my channel"%0a%3c %0a\ No newline at end of file%0a
  17. host:1626793013=198.251.81.133
  18. author:1626789673=mkf
  19. diff:1626789673:1626789634:=22d21%0a%3c -----%0a49a49%0a> %0a
  20. host:1626789673=198.251.81.133
  21. author:1626789634=mkf
  22. diff:1626789634:1621249306:=18,53c18%0a%3c ([[ircnow/servers|Full list of servers]])%0a%3c %0a%3c ---%0a%3c chanop%0a%3c Setting ChanServ on your channels allow you to set modes and your rules to manage it, even after you got disconnected.%0a%3c first, join the channel you want to get chanserv on it. this usually done by%0a%3c [@%0a%3c /join #yourchannelname%0a%3c @]%0a%3c if it didn't worked, check your client manual.%0a%3c %0a%3c then, check if that channel is not registered by someone else, by msg-ing chanserv info #yourchannelname%0a%3c [@%0a%3c /msg chanserv info #yourchannelname%0a%3c @]%0a%3c if it has been taken by someone else, it will show something like this:%0a%3c [@%0a%3c -ChanServ(services@services.irc.ircnow.org)- Information for channel #yourchannelname:%0a%3c -ChanServ(services@services.irc.ircnow.org)- Founder: mkf%0a%3c -ChanServ(services@services.irc.ircnow.org)- Description: yeah, that's my channel.%0a%3c -ChanServ(services@services.irc.ircnow.org)- Registered: Jul 20 06:34:21 2018 PDT (2 years ago)%0a%3c -ChanServ(services@services.irc.ircnow.org)- Last used: Jul 20 06:39:35 2022 PDT (now)%0a%3c -ChanServ(services@services.irc.ircnow.org)- Ban type: 2%0a%3c -ChanServ(services@services.irc.ircnow.org)- Mode lock: +nt%0a%3c -ChanServ(services@services.irc.ircnow.org)- Options: Peace, Security, Secure founder, Signed kicks, Topic retention%0a%3c -ChanServ(services@services.irc.ircnow.org)- Last topic: no, choose another name. this is my channel :^)%0a%3c -ChanServ(services@services.irc.ircnow.org)- Topic set by: mkf%0a%3c @]%0a%3c %0a%3c it says this channel has taken by some guy with nick "mkf". in that case choose another name.%0a%3c if it has not taken by someone else, it should show something like that:%0a%3c %0a%3c [@%0a%3c -ChanServ(services@services.irc.ircnow.org)- Channel #yourchannelname isn't registered.%0a%3c @]%0a%3c in that case, you can take it. however, some networks doesn't allow some names for channels, ask admins of your network about that.%0a---%0a> ([[ircnow/servers|Full list of servers]])%0a\ No newline at end of file%0a
  23. host:1626789634=198.251.81.133
  24. author:1621249306=mkf
  25. diff:1621249306:1597020583:=6,18c6%0a%3c fdfdsfd%0a%3c %0a%3c (:title IRCNow: The Users' Network:)%0a%3c %0a%3c '''IRCNow''' provides internet services for the '''free and open source''' community. IRCNow is a [[freedom/federation|federation of servers]] to create a network that ensures [[freedom/freedom|user freedom]]. Learn about [[ircnow/goals|our goals]].%0a%3c %0a%3c To chat with us, you can connect to following servers%0a%3c ||border=1 width=50%25%0a%3c ||!Connection ||! Server ||! Port ||%0a%3c || IPv4 || [@irc.ircnow.org@] || 6667 or 6697 (SSL) || %0a%3c || IPv6 || [@ipv6.ircnow.org@] || 6667 or 6697 (SSL) ||%0a%3c || Tor || [@ircnowuj3luixmmz.onion@] || 6667 or 6697 (SSL) ||%0a%3c ([[ircnow/servers|Full list of servers]])%0a\ No newline at end of file%0a---%0a> fdfdsfd%0a\ No newline at end of file%0a
  26. host:1621249306=91.185.142.211
  27. author:1597020583=jrmu
  28. diff:1597020583:1596101899:=5,6c5%0a%3c Test%0a%3c fdfdsfd%0a\ No newline at end of file%0a---%0a> Test%0a\ No newline at end of file%0a
  29. host:1597020583=38.81.163.143
  30. author:1596101899=
  31. diff:1596101899:1093548433:=3,5d2%0a%3c %0a%3c %0a%3c Test%0a\ No newline at end of file%0a
  32. host:1596101899=38.81.163.143