6

How to Install ProxySQL From the Percona Repository

 1 year ago
source link: https://www.percona.com/blog/how-to-install-proxysql-from-the-percona-repository/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to Install ProxySQL From the Percona Repository

April 8, 2020

Peter Zaitsev

install proxysql percona repository
This article describes how to install ProxySQL from the Percona Software Repositories.

Percona Software Repositories contain a ProxySQL version that has passed rigorous Percona tests and is known to be compatible with other Percona Software. We recommend using those builds whenever you’re running ProxySQL with Percona Server for MySQL, Percona XtraDB Cluster, MySQL, or MariaDB.

To install the Percona Repository for DEB-based distributions (Debian and Ubuntu) follow these instructions, and for RPM-based distributions (RedHat Enterprise Linux and Derivatives) follow these instructions.

At the time of this writing, ProxySQL 2 is the latest major release of ProxySQL and it is recommended for new installations. You can also install older ProxySQL version 1 by using “proxysql” instead of “proxysql2” as the package name.

To Install ProxySQL on DEB-based distributions, run:

Shell
sudo apt install proxysql2

To Install ProxySQL on RPM-based distributions, run:

Shell
sudo yum install proxysql2

After installation, ProxySQL will not be started automatically.  To start it, use:

Shell
sudo service proxysql start

Warning – Never run ProxySQL in productions with default credentials. You can change those credentials by editing the /etc/proxysql.cnf configuration file or (assuming you have the mysql client installed) by running:

Shell
mysql -uadmin -padmin -h127.0.0.1 -P6032 --prompt='\u (\d)>' main
admin (main)>UPDATE global_variables SET variable_value='admin:NEWPASSWORD' WHERE variable_name='admin-admin_credentials';
admin (main)>LOAD ADMIN VARIABLES TO RUNTIME;
admin (main)>SAVE ADMIN VARIABLES TO DISK;

This will set credentials for the ProxySQL Administrative user to user “admin” with the password “NEWPASSWORD”.

Bonus Tip:  If you do not want to remember this long command to access your ProxySQL admin interface, consider saving it to your .bashrc:

Shell
echo "alias psqladmin=\"mysql -uadmin -pNEWPASSWORD -h 127.0.0.1 -P 6032 --prompt='ProxySQLAdmin> '\"" >>$HOME/.bashrc

You can then proceed to configure ProxySQL according to your use-case.   

Further Reading:

Share This Post!

4 Comments

Oldest

gunni

3 years ago

For logging into mysql i additionally change the HISTFILE, so the proxysql specific wont get mixed up with the mysql queries.
MYSQL_HISTFILE=.proxysql_history mysql -uadmin -pNEWPASSWORD -h 127.0.0.1 -P 6032 –prompt=’ProxySQLAdmin> ‘

Author

Reply to  gunni

3 years ago

Thank you – Good hint!

john danilson

3 years ago

it would be helpful if proxysql was listed in “products” and links to a download page were provided.

We will have to figure out how to structure it better ProxySQL is not Percona’s product though we provide packages for convenience, it is different in this regard from Percona Server for MySQL and such.

</div


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK