Difference between revisions of "SBN - Database Server Notes"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
i.e.: Wikipedia, WordPress, WeeWX, etc... | i.e.: Wikipedia, WordPress, WeeWX, etc... | ||
− | == Installation == | + | ==Installation== |
===Linux Mint=== | ===Linux Mint=== | ||
Line 30: | Line 30: | ||
**(pretty much same as [[MySQL - Initial Configuration]] except the root password is already done...) | **(pretty much same as [[MySQL - Initial Configuration]] except the root password is already done...) | ||
− | == NON LOCALHOST ACCESS! == | + | ==NON LOCALHOST ACCESS!== |
+ | By default, MySQL binds to 127.0.0.1... | ||
+ | |||
+ | This is ugly, but works for now: | ||
+ | |||
+ | * <code>sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf</code> | ||
+ | |||
+ | & change | ||
+ | |||
+ | <code>bind-address = 127.0.0.1</code> | ||
+ | |||
+ | to | ||
+ | |||
+ | <code>bind-address = '''Actual IP Address'''</code> | ||
==Set up at least one user in mysql== | ==Set up at least one user in mysql== |
Revision as of 16:03, 22 July 2020
A dedicated server Just to run MySQL...
Then you can simply point all the other things that use it to a central location.
i.e.: Wikipedia, WordPress, WeeWX, etc...
Contents
Installation
Linux Mint
- Mint 19.3 Seems to get MySQL 5.7.30
- Mint 20 Gets MySQL 8.0.20
sudo apt install mysql-server mysql-client php-mysql
- Say Yes to Continue
- See MySQL - Initial Configuration for configuration
SparkyLinux
- Doesn't even have MySQL in the repositories...
- Getting MySQL onto SparkyLinux
- Which then gets MySQL 8.0.21
sudo apt install mysql-server mysql-client php-mysql
- Say Yes to Continue
- Configuring mysql-community-server
- Pick a good root password...
- I tend to select Use Legacy Authentication Method because Use Strong Password Encryption is annoying as hell. (Your choice here...)
- See MySQL - Initial Configuration B for configuration
- (pretty much same as MySQL - Initial Configuration except the root password is already done...)
NON LOCALHOST ACCESS!
By default, MySQL binds to 127.0.0.1...
This is ugly, but works for now:
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
& change
bind-address = 127.0.0.1
to
bind-address = Actual IP Address
Set up at least one user in mysql
sudo mysql -u root -p
- You will be asked for 2 passwords, your own & that of the root database user.
CREATE USER 'someone'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; EXIT;
(Hint: This'd be a good time to create yourself as that user with your non-admin password of choice...)
If this is to be a remotely accessed Database Server, 'localhost' will actually be the name/address of the remote machine you'll access from. (Possibly even '*')
Reference Materials
Useful Things
- Restart MySQL
sudo systemctl restart mysql.service
- Change a user password
ALTER USER 'userName'@'localhost' IDENTIFIED BY 'New-Password-Here';
- Trash a complete database (WARNING! DANGER! DAMAGE LIKELY!)
DROP DATABASE wp_Someblog;
- List existing databases
SHOW databases;
- List existing users
SELECT user,host FROM mysql.user;