Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, June 7, 2021

Build mysql from Source

 apt build-dep mariadb-server


mkdir mariadb-build
cd mariadb-build
git clone -b 10.5 https://github.com/MariaDB/server.git
mkdir mariadb
cd mariadb
cmake ../server -DBUILD_CONFIG=mysql_release
make package

 

Wait about 30 min for build, it will export binary file tarball .tar.gz

Copy that file to home and extract it

cd mariadb-version

Create some directories for log, config...

mkdir log
mkdir tmp
mkdir database
mkdir binlog

Create my.cnf file and .sh files for simplified action

Copy shared libraries to portablelib, use generate_portablelib.sh



Monday, September 21, 2020

Allow remote connection MySQL

 

Your root account, and this statement applies to any account, may only have been added with localhost access (which is recommended).

You can check this with:

SELECT host FROM mysql.user WHERE User = 'root';

If you only see results with localhost and 127.0.0.1, you cannot connect from an external source. If you see other IP addresses, but not the one you're connecting from - that's also an indication.

You will need to add the IP address of each system that you want to grant access to, and then grant privileges:

CREATE USER 'root'@'ip_address' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'ip_address';

If you see %, well then, there's another problem altogether as that is "any remote source". If however you do want any/all systems to connect via root, use the % wildcard to grant access:

CREATE USER 'root'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

Finally, reload the permissions, and you should be able to have remote access:

FLUSH PRIVILEGES;