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.
I am used to using phpmyadmin to manage the MySQL database for many years. Just recently, I saw an alternative way to do it. Adminer, a full-featured database management tool written in PHP.
Official site of Adminer
The latest version is v4.7.1 when I write this post.
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)
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.
hhvm.mysql.socket = /tmp/mysql.sock
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
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
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%.
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:
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.
At this step, you can add database or do other tasks in Webmin.
It is a smoothly converting without hurting data inside of the tables.
I have phpmyadmin installation on my VPS. So just goto there and select database, click SQL tab of it.
Enter following sql and click Go.
ALTER TABLE tablename ENGINE = INNODB;
The error when I try to start MySQL server in the VPS.
Another MySQL daemon already running with the same unix socket
I googled it and found the solution.
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
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.
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.
Before install Apache2, PHP5 and MySQL, install CentOS 6.3 server first.
Followed the steps to install these staff.
1) Installing MySQL 5