So, here's a simple step to add a swap space (Read more for details):
Common MySQL Queries
See also: Guide to Tuning MySQL for Performance
Aggregates
|
||
SubjectCentos 7.3 How to install Apache 2.4, PHP 7.1 and MySQL (MariaDB)Enable NetworkDisplay network status # nmcli d Start network manager # nmtui Edit the connection to Automatically connect Make GUI DefaultCentos 7 # yum group install "GNOME Desktop" "Graphical Administration Tools" RHEL 7 # yum groupinstall "Server with GUI" Run the following to make the GUI start on reboot
# ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target
Start SSH service# systemctl restart sshd.service # firewall-cmd --add-port=22/tcp --permanent # firewall-cmd --reload Adding Swap Space to Linux without RebootingToday I got an error in MySQL "InnoDB: Error: connot allocate bytes... you should increase swap"
I wanted to add more swap you can do it with a file like below or if you have space create a partition or logical volume (lv). So, here's a simple step to add a swap space (Read more for details): mysql 145 Table is marked as crashed and should be repairedGot error: 145: Table {sometable} is marked as crashed and should be repairedI got the this error when trying to do a sqldump of my database. To fix this error use the utility mysqlcheck from the command line. This statment shows that the table is marked as crashed: # mysqlcheck -uuser -ppass database table This statement will repair the table: # mysqlcheck -uroot -pvisitor --auto-repair database table SubjectMySQL What is happening?The 5.1 release was very slow getting released
MySQL 5.1 Sun/Oracle version we now consider it stable Oracle bought MySQL, and it has gone OK so far. Use the Innodb Plugin is much better performance than the included version. MySQL 5.4Join Optimizations, Stored Procedures, General Scalability Improvements MySQL 5.5
SubjectPostgreSQL CommandsUseful SQL for DBAs
List all tables in the current database: => SELECT tablename FROM pg_tables where tablename not like 'pg_%'; Limit rows returned as in where rownum <= 10 => select tablename from pg_tables limit 10; List tables in one schema => select tablename from pg_tables where tableowner='qedit'; List running queries => select * from pg_stat_activity; List database activity SubjectPostgreSQL Procedural Langauage - plpgsqlRun the command to install procedural languages or you will get: SubjectPostgresQL on FedoraInstalling PostgreSQL on Fedora Core
yum -y install postgresql postgresql-server php-pgsql
/sbin/chkconfig postgresql on
SubjectConvert your MySQL database from MyISAM to InnoDBBefore you go any further backup your database before doing any steps below. If you 'splode your database for any reason, you'll need it. Here are the steps:
SubjectHow to optimize mysql tables in DrupalHow to optimize my Drupal database? The easiest way is to install the DB Maintenance module. Information on how to install a Drupal module is available in our Drupal tutorial. After the module is installed and activated, you can access it from your Drupal admin area > Administer > Site configuration > DB maintenance. Select the tables which you wish to optimize and click Optimize now. |