Currently Viewing Posts Tagged MySQL

Hot to fix the problem on the new installation MariaDB

After the installation of MySQL server or MariaDB on Ubuntu, I would like to use phpMyAdmin or Adminer to access the MySQL server. But the first time the error comes like below.

Access denied for user ‘root’@’localhost’

mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’localhost’

MySQL connect error on phpMyAdmin

 

MySQL connect error on Adminer

Here is the solution to make the root connect to a server without error.

Continue reading “Hot to fix the problem on the new installation MariaDB”

HHVM 3.6 has problem with MariaDB

The same script php file, always works smoothly on HHVM 3.2 to HHVM 3.5. Until I upgrade it to HHVM 3.6.

It is a simply script which use mysqli connection and so on. Now it is shown the error as below:

Connect failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I tried to find the answer and faild. So I upgrde the HHVM to nightly build version. It is 3.7-dev.

davidyin@fiob:/etc/hhvm$ hhvm --version
HipHop VM 3.7.0-dev (rel)
Compiler: heads/master-0-g0359d4a4bbb22c5defd7eb024194aed0af24c80b
Repo schema: 9008d5e6e7f6584d09ed3b14deceac5a34f363c1

And it did solve the error, and the script is working as expected.

But, later I found the reason why it happen.

Add

hhvm.mysql.socket = /tmp/mysql.sock

into server.ini

To specify the mysql socket and let HHVM knows how to connect mySQL server or MariaDB server.

I did not try the solution.  I found it here.

Switch to bzip2 compression on my server backup scripts

Previously I used gzip as compression tool to compress the web site files and mysql database.  It is still working on my Linode server. I learned something from the compairasion from this post .

So I tried to use bzip instead of gzip on my backup script.

Here is two examples.

1) Mysqldump file, which is a text sql file.

The original sql file is 52,317KB

  • gzip with level 9 (best) compression:  23,227KB  – Compress Ratio 44.39%
  • bzip2 with default (I think it is level 9) compression: 19,666KB – Compress Ratio 37.59%

Bzip2 is smaller than gzip file. It reduced about 15%.

2) Website files, including php, jpeg, png, css, any files used in web site.

The original tar gile is 187,670KB

  • gzip compression: 42,101KB – Ratio 22.43%
  • bzip2 compression: 34,753KB – Ratio 18.51%

Bzip2 is better. Backup file size is reduced by about 17%.

Continue reading “Switch to bzip2 compression on my server backup scripts”

How to manage MariaDB in Webmin

It is easy to use Webmin to manage VPS, including MySQL server.  But it is not working with MariaDB default.

The webmin MySQL server shows error as below:

mariadb-webmin

It can not find the path of command to start and stop MariaDB and also config file of MariaDB server.

So click module configuration and change:
Command to start MySQL server: /etc/init.d/mysql start
Command to stop MySQL server: /etc/init.d/mysql stop
MySQL configuration file: /var/lib/mysql/my.cnf

If your MariaDB server configuration file is not in this location, double check your setting and enter the correct value.

After saving, it will ask for your username and password to connect your MariaDB server.  Enter them and save.

mariadb-settings

At this step, you can add database or do other tasks in Webmin.

bc not found error when running Mysql tuning primer script

To fine tuning mysql server, run Mysql tuning primer script on server.

But I got error which said bc is not found. So just enter following yum install bc to install it.

[root@vps test]# ./tuning-primer.sh
which: no bc in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
Error: Command line calculator 'bc' not found!
[root@vps test]# yum install bc

Install LEMP on Centos 6.4 64bit at Burst.Net VPS

It is a guide to install LEMP on a Centos 6.4 64bit VPS at Burst.net. It is also working on other VPS. LEMP stands for Linux, NginX, MySQL, PHP.

First of all, rebuild the OS on VPS with Centos-6.2-x86_64.
os-load

Other VPS providers have similar interface to rebuild / reload operation system.

After 5 to 10 minutes, the VPS is ready to use.

SSH to VPS through PUTTY with root account.  The following installation steps will be done in terminal window.

1) Update the system to Centos 6.4

yum update

There are 158 updates need to be installed. So just confirm it and wait all the updates completed. Then the Centos is updated from 6.2 to 6.4.

Continue reading “Install LEMP on Centos 6.4 64bit at Burst.Net VPS”

  • Archives