Installing MySQL on Debian Rumi, September 26, 2020 Step 1 – Prerequisites Login to your Debian 9 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection. ssh root@debian9 Run below commands to upgrade the current packages to the latest version. sudo apt update sudo apt upgrade Step 2 – Configure MySQL PPA MySQL team provides official MySQL PPA for Debian Linux. You can download and install the package on your Debian system, which will add PPA file to your system. Run below command to enable PPA. wget http://repo.mysql.com/mysql-apt-config_0.8.13-1_all.deb sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb During the installation of MySQL apt config package, It will prompt to select MySQL version to install. Select the MySQL 5.7 or 5.6 option to install on your system. Step 3 – Install MySQL on Debian 9 Your system is ready for the MySQL installation. Run the following commands to install MySQL on a Debian machine. sudo apt update sudo apt install mysql-server The installation process will prompt for the root password to set as default. Input a secure password and same to confirm password window. This will be MySQL root user password required to log in to MySQL server. Step 4 – Secure MySQL Installation Execute the below command on your system to make security changes on your Database server. This will prompt some questions. The do the high security provide all answers to yes. First start the MysQL service if not started: sudo systemctl restart mysql Then run below command: sudo mysql_secure_installation Step 5 – Connect MySQL The MySQL server has been installed on your system. Now connect to the MySQL database using the command line. mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.21 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> Src: https://tecadmin.net/install-mysql-server-on-debian9-stretch/ Related MySQL DebianMySQLMySQL 5.6MySQL 5.7
MySQL my.cnf tweak for faster importing large database March 3, 2018 Few small hack will ease you importing large sized mysql dump in a bit faster process. The trick worked for me for a 70 GB dumped sql, can’t guarantee it’d work for you! Step-1 need to change the following: innodb_buffer_pool_size = 4G innodb_log_buffer_size = 256M innodb_log_file_size = 1G innodb_write_io_threads =… Read More
Error 2020: Got packet bigger than ‘max_allowed_packet’ bytes when dumping table `migrations` at row: 1 April 26, 2018 You can add –max_allowed_packet=512M to your mysqldump command. Or add max_allowed_packet=512M to [mysqldump] section of your my.cnf Note: it will not work if it is not under the [mysqldump] section… Related Read More
MySQL: Show Users, Privileges and Passwords December 29, 2020 Show all MySQL users: mysql> SELECT user FROM mysql.user; List only unique user names: mysql> SELECT DISTINCT user FROM mysql.user; Show MySQL users and hosts they are allowed to connect from: mysql> SELECT user,host FROM mysql.user; Show MySQL users, their passwords and hosts: mysql> SELECT user,host,password FROM mysql.user; in MySQL… Read More