mysql

* Take dump of all databases:
# mysqldump --skip-lock-tables -A > alldb.sql * * Check where MySQL keeps its files(in my case it's /var/lib/mysql/):
# mysql -NBe "SELECT @@datadir" * /var/lib/mysql/ * * Stop MySQL
# mysqladmin shut * * Move old MySQL files to safe place 
# mv /var/lib/mysql /var/lib/mysql.old * * Create new system database
# mkdir /var/lib/mysql * # sudo apt-get install mysql-server * * Start MySQL
# /etc/init.d/mysql start * * Restore the dump
#...

Read More
mariadb

Prepare MariaDB for Upgrade To prepare MariaDB for Upgrade, logon to the database server as root with the root password and run the commands below sudo mysql -u root -p Then run the commands below to set innodb_fast_shutdown to 0 mysql> SET GLOBAL innodb_fast_shutdown = 0; Backup Your Databases It’s always important to backup your databases before attempting to upgrade To back up, run the commands below against each database you wish...

Read More
mysql

Log in to MySQL from terminal mysql -u root -p Run MySQL commands CREATE database_name; CREATE USER 'some_user'@'localhost' IDENTIFIED WITH mysql_native_password BY ‘your_password’; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, REFERENCES ON database_name.* TO 'some_user'@'localhost'; Edit above privileges as needed  ...

Read More
phpmyadmin

  Edit file /usr/share/phpmyadmin/libraries/sql.lib.php using this command: sudo nano +613 /usr/share/phpmyadmin/libraries/sql.lib.php On line 613 the count function always evaluates to true since there is no closing parenthesis after $analyzed_sql_results['select_expr']. Making the below replacements resolves this, then you will need to delete the last closing parenthesis on line 614, as it's now an extra parenthesis. Replace: ((empty($analyzed_sql_results['select_expr'])) || (count($analyzed_sql_results['select_expr'] == 1) ...

Read More
phpmyadmin

MySQL 5.7 and above Creating a Superuser for phpMyAdmin In terminal, log in to MySQL as root. sudo mysql -p -u root CREATE USER 'pmauser'@'localhost' IDENTIFIED BY 'password_here'; Now we will grant superuser privilege to our new user pmauser. GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'localhost' WITH GRANT OPTION; You should now be able to access phpMyAdmin using this new user account....

Read More
linux

What is a LAMP Stack? A LAMP (Linux, Apache, MySQL, PHP) stack is a common, free, and open-source web stack used for hosting web content in a Linux environment. Many consider it the platform of choice on which to develop and deploy high-performance web apps. Before You Begin Update your system: sudo apt update && sudo apt upgrade Install Using Tasksel Instead of installing Apache, MySQL, and PHP separately, Tasksel...

Read More
linux

Introduction A "LAMP" stack is a group of open-source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server. The site data is stored in a MySQL database, and dynamic content is processed by PHP. In this guide, we will install a LAMP...

Read More