[How-To]Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

[How-To]Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby rty » Sun Feb 10, 2013 9:41 am

Here are the steps that I used to install Nginx, PHP, MySQL and phpMyAdmin on my Pogoplug series 4. ArchWiki should be the best reference and this step-by-step guide is only meant for rookies like me.

1. Install nginx and php modules:

$this->bbcode_second_pass_code('', 'pacman -S nginx php php-fpm ')

2. Start nginx daemon

$this->bbcode_second_pass_code('', 'systemctl start nginx ')

3. Make sure nginx works by testing it with the browser on another computer, i.e. http://ip-address-of-the-server.

If NGINX fails to start with bind to 0.0.0.0 error, use fuser command to find out if there is any process occupying TCP port 80. If there is, kill the process using the process number and start nginx again:

$this->bbcode_second_pass_code('', 'fuser -n tcp 80
kill -9 process_number ')

4. Start php-fpm:

$this->bbcode_second_pass_code('', 'systemctl start php-fpm ')


5. Edit to replace the contents of the /etc/nginx/nginx.conf with the following lines:

Note: By default, nginx will look for htm/html files in /usr/share/nginx/ folder. This step will change nginx to look for .php file in /srv/http instead (needed to make it work with php?)

Note: Please make a backup copy of the original /etc/nginx/nginx.conf just in case.

$this->bbcode_second_pass_code('', '#user http;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;

keepalive_timeout 15;

gzip on;
gzip_comp_level 1;

server {

listen 80;
server_name localhost;

location ~ \.php {
root /srv/http;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location / {
root /srv/http;
index index.php;
}
}

}
')
6. Create /srv/http/index.php with some php codes in it and use the browser on another computer to test.

Once everything is tested OK, execute the following commands to make PHP and NGINX run automatically after every reboot:

$this->bbcode_second_pass_code('', 'systemctl enable php-fpm
systemctl enable nginx')
Last edited by rty on Tue Feb 19, 2013 7:22 am, edited 5 times in total.
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby rty » Sun Feb 10, 2013 9:42 am

7. Install MySQL

$this->bbcode_second_pass_code('', 'pacman -S mysql
systemctl start mysqld
systemctl enable mysqld ')

8. Configure MySQL

$this->bbcode_second_pass_code('', '/usr/bin/mysql_secure_installation ')
Answer "Yes" to all Yes/No questions is recommended.

9. Install PhpMyAdmin

$this->bbcode_second_pass_code('', 'pacman -S phpmyadmin php-mcrypt
ln -s /usr/share/webapps/phpMyAdmin /srv/http/phpMyAdmin ')

10. Configure nginx

$this->bbcode_second_pass_code('', 'nano /etc/nginx/nginx.conf ')

Replace the content with the following:

Note: Please make a backup copy of /etc/nginx/nginx.conf just in case

$this->bbcode_second_pass_code('', '#user http;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
sendfile on;
keepalive_timeout 15;
gzip on;
gzip_comp_level 1;
server {
listen 80;
server_name localhost; location ~ \.php$ {
root /srv/http;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;

}
location /phpmyadmin {
rewrite ^/* /phpMyAdmin last;
}


location / {
root /srv/http;
index index.php;
}
}
}')

11. Configure PHP

$this->bbcode_second_pass_code('', 'nano /etc/php/php.ini ')

Locate and edit to include the directories as highlighted in red in following line:

$this->bbcode_second_pass_code('', 'open_basedir= /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/ ')

Locate and uncomment the lines below:

$this->bbcode_second_pass_code('', 'extension=mysqli.so
extension=mysql.so
extension=mcrypt.so
mysqli.allow_local_infile = On ')

12. Restart PHP and nginx

$this->bbcode_second_pass_code('', 'systemctl restart php-fpm
systemctl restart nginx ')

13. Use the browser in another computer to test phpmyadmin by pointing to http://server-ip-address/phpmyadmin

Remember: Everytime you make changes to php.ini, you must restart php-fpm service, and for nginx.conf, restart nginx.

Note: If phpMyAdmin gives you the error message: "Cannot start session without errors", try deleting cookies of your browser or edit /etc/php/php.ini to the following:

$this->bbcode_second_pass_code('', 'session.save_path=/tmp ')
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby winestock » Mon Feb 11, 2013 7:58 pm

I would suggest using mariadb instead of MySql. In my testing I found that MySql was too slow, mariadb is the better choice. https://wiki.archlinux.org/index.php/MariaDB
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby rty » Tue Feb 12, 2013 10:45 am

$this->bbcode_second_pass_quote('winestock', 'I') would suggest using mariadb instead of MySql. In my testing I found that MySql was too slow, mariadb is the better choice. https://wiki.archlinux.org/index.php/MariaDB


Thanks winestock. Care to outline the steps to install mariadb? I tried to install it on my V2 and series 4. Both failed to start mariadb. I followed the Wiki page instructions by removing mysql first and installed mariadb but "systemctl" failed to start it afterward.

$this->bbcode_second_pass_quote('', '#') systemctl status mysqld
mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service)
Active: failed (Result: start-limit) since Tue 2013-02-12 12:26:18 AST; 3h 11min ago
Process: 424 ExecStop=/bin/kill -15 $MAINPID (code=exited, status=1/FAILURE)
Process: 421 ExecStart=/usr/bin/mysqld --pid-file=/var/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)

Feb 12 12:26:18 pogo2 systemd[1]: mysqld.service: control process exited, code=exited status=1
Feb 12 12:26:18 pogo2 systemd[1]: Unit mysqld.service entered failed state
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby winestock » Tue Feb 12, 2013 2:40 pm

$this->bbcode_second_pass_quote('rty', '')$this->bbcode_second_pass_quote('winestock', 'I') would suggest using mariadb instead of MySql. In my testing I found that MySql was too slow, mariadb is the better choice. https://wiki.archlinux.org/index.php/MariaDB


Thanks winestock. Care to outline the steps to install mariadb? I tried to install it on my V2 and series 4. Both failed to start mariadb. I followed the Wiki page instructions by removing mysql first and installed mariadb but "systemctl" failed to start it afterward.

$this->bbcode_second_pass_quote('', '#') systemctl status mysqld
mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service)
Active: failed (Result: start-limit) since Tue 2013-02-12 12:26:18 AST; 3h 11min ago
Process: 424 ExecStop=/bin/kill -15 $MAINPID (code=exited, status=1/FAILURE)
Process: 421 ExecStart=/usr/bin/mysqld --pid-file=/var/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE)

Feb 12 12:26:18 pogo2 systemd[1]: mysqld.service: control process exited, code=exited status=1
Feb 12 12:26:18 pogo2 systemd[1]: Unit mysqld.service entered failed state


What I have found is that after I uninstalled mysql, config files were still left on my system. To cover all bases I suggest you re-install mariadb again. First I would:
$this->bbcode_second_pass_code('', '
sudo systemctl disable mysqld
sudo pacman -Rsn mariadb
')
Next, find and remove all left behind mysql config files:
$this->bbcode_second_pass_code('', '
sudo find / -name mysql
')
Make a backup copy of /etc/mysql/my.cnf. Remove all 'mysql' directories and files that the find command returned, including /etc/mysql/my.cnf. Now re-install mariadb again:
$this->bbcode_second_pass_code('', '
sudo pacman -Syu mariadb
')
One thing I found after I installed and ran mariadb for the first time, the default configuration is setup to use a lot of RAM and run the INNODB engine. The memory pool is set to use a lot of RAM. I would suggest starting by setting the memory pool low. Later you can readjust the size higher:
$this->bbcode_second_pass_code('', '
innodb_buffer_pool_size = 10M
innodb_additional_mem_pool_size = 2M
')
Now start mysqld:
$this->bbcode_second_pass_code('', '
sudo systemctl start myslqd
sudo systemctl status mysqld
')
If mysqld fails to start then I would check the /var/lib/mysql directory and the contents of /var/lib/mysql that the ownership is mysql.mysql.

Next I would download 2 mysql tuning scripts. These are great because they will evaluate your mysql config and tell you what needs to be adjusted:
$this->bbcode_second_pass_code('', '
wget mysqltuner.sh
wget tuning-primer.sh
')
With mysqld running, execute the mysqltuner.sh first followed by tuning-primer.sh. Of the two scripts, I find tuning-primer.sh the most useful.
Last edited by winestock on Wed Feb 13, 2013 4:26 pm, edited 1 time in total.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am
Top

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby rty » Tue Feb 12, 2013 4:11 pm

Do we have to add user 'mysql' first? If yes, what are the settings for 'mysql' user?

This is what I got:

$this->bbcode_second_pass_quote('', '[')root@pogo2 ~]# pacman -Sy mariadb
:: Synchronizing package databases...
core is up to date 0.0 B 0.00B/s 00:00 [-------------------------] 0%
extra is up to date 0.0 B 0.00B/s 00:00 [-------------------------] 0%
community is up to date 0.0 B 0.00B/s 00:00 [-------------------------] 0%
alarm is up to date
aur is up to date
resolving dependencies...
looking for inter-conflicts...

Targets (1): mariadb-5.5.29-1

Total Installed Size: 85.14 MiB

Proceed with installation? [Y/n] y
(1/1) checking package integrity [#########################] 100%
(1/1) loading package files [#########################] 100%
(1/1) checking for file conflicts [#########################] 100%
(1/1) checking available disk space [#########################] 100%
(1/1) installing mariadb [#########################] 100%
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h pogo2 password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://kb.askmonty.org or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems with the '/usr/scripts/mysqlbug' script!

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from
Monty Program Ab. You can contact us about this at sales@montyprogram.com.
Alternatively consider joining our community based development effort:
http://kb.askmonty.org/en/contributing- ... b-project/

Optional dependencies for mariadb
perl-dbi
perl-dbd-mysql
[root@pogo2 ~]# systemctl start mysqld.service
[root@pogo2 ~]# systemctl status mysqld
mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled)
Active: active (running) since Tue 2013-02-12 18:46:17 AST; 5s ago
Main PID: 2335 (mysqld)
CGroup: name=systemd:/system/mysqld.service
ââ2335 /usr/bin/mysqld --pid-file=/var/run/mysqld/mysqld.pid

Feb 12 18:46:19 pogo2 mysqld[2335]: InnoDB: Doublewrite buffer created
Feb 12 18:46:19 pogo2 mysqld[2335]: InnoDB: 127 rollback segment(s) active.
Feb 12 18:46:20 pogo2 mysqld[2335]: InnoDB: Creating foreign key constraint sy...es
Feb 12 18:46:20 pogo2 mysqld[2335]: InnoDB: Foreign key constraint system tabl...ed
Feb 12 18:46:20 pogo2 mysqld[2335]: 130212 18:46:20 InnoDB: Waiting for the b...rt
Feb 12 18:46:21 pogo2 mysqld[2335]: 130212 18:46:21 Percona XtraDB (http://www... 0
Feb 12 18:46:21 pogo2 mysqld[2335]: 130212 18:46:21 [Note] Plugin 'PBXT' is di...d.
Feb 12 18:46:21 pogo2 mysqld[2335]: 130212 18:46:21 [Note] Event Scheduler: Lo...ts
Feb 12 18:46:21 pogo2 mysqld[2335]: 130212 18:46:21 [Note] /usr/bin/mysqld: re...s.
Feb 12 18:46:21 pogo2 mysqld[2335]: Version: '5.5.29-MariaDB-log' socket: '/v...on
[root@pogo2 ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
/usr/bin/mysql_secure_installation: line 207: /usr/bin/mysql: No such file or directory
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
/usr/bin/mysql_secure_installation: line 207: /usr/bin/mysql: No such file or directory
Password update failed!
Cleaning up...
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore
Top

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby winestock » Tue Feb 12, 2013 5:58 pm

$this->bbcode_second_pass_quote('rty', 'D')o we have to add user 'mysql' first? If yes, what are the settings for 'mysql' user?

This is what I got:

$this->bbcode_second_pass_quote('', '[')root@pogo2 ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
/usr/bin/mysql_secure_installation: line 207: /usr/bin/mysql: No such file or directory
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
/usr/bin/mysql_secure_installation: line 207: /usr/bin/mysql: No such file or directory
Password update failed!
Cleaning up...


I think when mariadb is installed it creates the mysql user. It looks like a incomplete install for some reason. The good news is you got mysqld to start.

What happens if you:
$this->bbcode_second_pass_code('', '
sudo pacman -Syu mariadb
mysql_secure_installation
')

I am wondering if "-Syu" will help in this case. After you do this you will have to fix the /etc/mysql/my.cnf file again.

EDIT: I just re-ran mysql_secure_installation:
$this->bbcode_second_pass_code('', '
[root@MediaServer ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
')

I also get "/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found", so I would not be too concerned about that. The part that is perplexing is why you don't have /usr/bin/mysql installed.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am
Top

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby rty » Wed Feb 13, 2013 5:48 am

$this->bbcode_second_pass_quote('winestock', 'T')he good news is you got mysqld to start.

That's right. I didn't completely remove all traces of previous Mysql in my first attempt. I only managed to get mysqld service started this time after following your tips wiping out MySql entirely first. I wish Arch Wiki would state this clearly.

$this->bbcode_second_pass_quote('winestock', '
')I also get "/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found", so I would not be too concerned about that. The part that is perplexing is why you don't have /usr/bin/mysql installed.


I really wish to see software like mariadb success but it looks like Mariadb isn't ready for prime-time yet, after all it's touted to be a "drop-in" replacement for MySql which as far as I remember never gives me any problem during installation and configuration.

$this->bbcode_second_pass_quote('winestock', '
')systemctl start mariadb
systemctl enable mariadb


You might want to edit these lines in your previous post to change "mariadb" to "mysqld" as per Wiki.

$this->bbcode_second_pass_quote('winestock', '
')I am wondering if "-Syu" will help in this case.


I'll give Mariadb another try this weekend if my back isn't killing me and will let you know. Thanks.
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore
Top

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby winestock » Wed Feb 13, 2013 12:38 pm

$this->bbcode_second_pass_quote('rty', '')$this->bbcode_second_pass_quote('winestock', '
')systemctl start mariadb
systemctl enable mariadb


You might want to edit these lines in your previous post to change "mariadb" to "mysqld" as per Wiki.


Oops, sorry about that.
Pogoplug Series 4 / Linux-Kirkwood 3.10.10-2
winestock
 
Posts: 134
Joined: Mon Nov 05, 2012 12:03 am
Top

Re: Install Nginx, PHP, MySQL (LEMP) and phpMyAdmin

Postby rty » Fri Feb 15, 2013 5:24 am

Alright, as promised, I have tried to install Mariadb again as an alternative to MySql. Here are the steps I took:

1. Back up MySql data and its configuration file.

2. Stop and uninstal MySql

$this->bbcode_second_pass_code('', 'systemctl stop mysqld
systemctl disable mysqld
pacman -Rns mysql')

3. Ensure all remaining MySql files are removed.

As suggested by Winestock, I used the command: "find / -name mysql" to find if there were any remaining MySql file or folder. In my Pogo V2, I found the following:
$this->bbcode_second_pass_quote('', '/')var/lib/mysql
/var/lib/mysql/mysql


4. Remove the folders:
$this->bbcode_second_pass_code('', 'rm -r /var/lib/mysql')
5. Reboot

6. Install Mariadb and configure it:

$this->bbcode_second_pass_quote('', 'p')ogo2:~$ pacman -Syu mariadb
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
alarm is up to date
aur is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for inter-conflicts...

Targets (3): libmariadbclient-5.5.29-1 mariadb-clients-5.5.29-1 mariadb-5.5.29-1

Total Installed Size: 138.84 MiB

Proceed with installation? [Y/n] y
(3/3) checking package integrity [#########################] 100%
(3/3) loading package files [#########################] 100%
(3/3) checking for file conflicts [#########################] 100%
(3/3) checking available disk space [#########################] 100%
(1/3) installing libmariadbclient [#########################] 100%
(2/3) installing mariadb-clients [#########################] 100%
(3/3) installing mariadb [#########################] 100%
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h pogo2 password 'new-password'

Alternatively you can run:
'/usr/bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://kb.askmonty.org or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr' ; /usr/bin/mysqld_safe --datadir='/var/lib/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/mysql-test' ; perl mysql-test-run.pl

Please report any problems with the '/usr/scripts/mysqlbug' script!

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Support MariaDB development by buying support/new features from
Monty Program Ab. You can contact us about this at sales@montyprogram.com.
Alternatively consider joining our community based development effort:
http://kb.askmonty.org/en/contributing- ... b-project/

Optional dependencies for mariadb
perl-dbi
perl-dbd-mysql
pogo2:~$ ls /usr/bin/my*
/usr/bin/myisamchk /usr/bin/mysqldumpslow
/usr/bin/myisam_ftdump /usr/bin/mysql_embedded
/usr/bin/myisamlog /usr/bin/mysql_find_rows
/usr/bin/myisampack /usr/bin/mysql_fix_extensions
/usr/bin/my_print_defaults /usr/bin/mysqlhotcopy
/usr/bin/mysql /usr/bin/mysqlimport
/usr/bin/mysqlaccess /usr/bin/mysql_install_db
/usr/bin/mysqladmin /usr/bin/mysql_plugin
/usr/bin/mysqlbinlog /usr/bin/mysql_secure_installation
/usr/bin/mysqlbug /usr/bin/mysql_setpermission
/usr/bin/mysqlcheck /usr/bin/mysqlshow
/usr/bin/mysql_client_test /usr/bin/mysqlslap
/usr/bin/mysql_config /usr/bin/mysqltest
/usr/bin/mysql_convert_table_format /usr/bin/mysql_tzinfo_to_sql
/usr/bin/mysqld /usr/bin/mysql_upgrade
/usr/bin/mysqld_multi /usr/bin/mysql_waitpid
/usr/bin/mysqld_safe /usr/bin/mysql_zap
/usr/bin/mysqldump /usr/bin/mytop
pogo2:~$ systemctl start mysqld.service
pogo2:~$ systemctl status mysqld
mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled)
Active: active (running) since Fri 2013-02-15 08:00:10 AST; 6s ago
Main PID: 380 (mysqld)
CGroup: name=systemd:/system/mysqld.service
ââ380 /usr/bin/mysqld --pid-file=/var/run/mysqld/mysqld.pid

Feb 15 08:00:12 pogo2 mysqld[380]: InnoDB: Doublewrite buffer created
Feb 15 08:00:13 pogo2 mysqld[380]: InnoDB: 127 rollback segment(s) active.
Feb 15 08:00:13 pogo2 mysqld[380]: InnoDB: Creating foreign key constraint sys...es
Feb 15 08:00:13 pogo2 mysqld[380]: InnoDB: Foreign key constraint system table...ed
Feb 15 08:00:13 pogo2 mysqld[380]: 130215 8:00:13 InnoDB: Waiting for the ba...rt
Feb 15 08:00:14 pogo2 mysqld[380]: 130215 8:00:14 Percona XtraDB (http://www.... 0
Feb 15 08:00:14 pogo2 mysqld[380]: 130215 8:00:14 [Note] Plugin 'PBXT' is dis...d.
Feb 15 08:00:15 pogo2 mysqld[380]: 130215 8:00:15 [Note] Event Scheduler: Loa...ts
Feb 15 08:00:15 pogo2 mysqld[380]: 130215 8:00:15 [Note] /usr/bin/mysqld: rea...s.
Feb 15 08:00:15 pogo2 mysqld[380]: Version: '5.5.29-MariaDB-log' socket: '/va...on

pogo2:~$ mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

pogo2:~$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 5.5.29-MariaDB-log Source distribution

Copyright (c) 2000, 2012, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name | Value |
+-------------------------+---------------------+
| innodb_version | 1.1.8-29.3 |
| protocol_version | 10 |
| slave_type_conversions | |
| version | 5.5.29-MariaDB-log |
| version_comment | Source distribution |
| version_compile_machine | armv5tel |
| version_compile_os | Linux |
+-------------------------+---------------------+
7 rows in set (0.05 sec)


MariaDB [(none)]> exit
Bye
pogo2:~$


Thank you Winestock! :D :D :D
Alarm + Samba + NginX + Php+ MySQL + phpMyAdmin on Raspberry Pi 3, Pogoplug 4, Pogoplug E02, Seagate Goflex Home
rty
 
Posts: 75
Joined: Sun Jun 03, 2012 8:57 am
Location: Singapore
Top

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 10 guests