UBUNTU SERVER 18.04 installare MySQL - PhpMyAdmin
Inviato: ven ott 25, 2019 8:21 pm
installazione MySQL
1)update the package index on your server with
2)Then install the default package:
3)for fresh installations, you’ll want to run the included security script. This changes some of the less secure default options for things like remote root logins and sample users. On older versions of MySQL, you needed to initialize the data directory manually as well, but this is done automatically now.
Run the security script:
4)In Ubuntu systems running MySQL 5.7 (and later versions), the root MySQL user is set to authenticate using the auth_socket plugin by default rather than with a password. This allows for some greater security and usability in many cases, but it can also complicate things when you need to allow an external program (e.g., phpMyAdmin) to access the user.
In order to use a password to connect to MySQL as root, you will need to switch its authentication method from auth_socket to mysql_native_password. To do this, open up the MySQL prompt from your terminal:
Next, check which authentication method each of your MySQL user accounts use with the following command:
In this example, you can see that the root user does in fact authenticate using the auth_socket plugin. To configure the root account to authenticate with a password, run the following ALTER USER command. Be sure to change password to a strong password of your choosing, and note that this command will change the root password you set in Step 2:
(password con gli apici)
Then, run FLUSH PRIVILEGES which tells the server to reload the grant tables and put your new changes into effect:
Check the authentication methods employed by each of your users again to confirm that root no longer authenticates using the auth_socket plugin:
You can see in this example output that the root MySQL user now authenticates using a password. Once you confirm this on your own server, you can exit the MySQL shell:
Testing MySQL
If MySQL isn’t running, you can start it with sudo systemctl start mysql.
For an additional check, you can try connecting to the database using the mysqladmin tool, which is a client that lets you run administrative commands. For example, this command says to connect to MySQL as root (-u root), prompt for a password (-p), and return the version.
You should see output similar to this:
This means MySQL is up and running.
from https://www.digitalocean.com/community/ ... untu-18-04
installazione PMA
1)Update the apt package tool to ensure we are working with the latest and greatest.
2)install phpMyAdmin and PHP extensions for managing non-ASCII string and necessary tools
During this installation you’ll be asked for the webserver selection, we will select Apache2 and select ENTER.
3)Enable PHP extension
4)If you’re running multiple domains on one server then you’ll want to configure your /etc/apache2/apache2.conf to enable phpMyAdmin to work
Add:
5)Restart the Apache service to recognize the changes made to the system.
6)Verify phpMyAdmin installation by going to http://ip/phpmyadmin (username phpmyadmin).
from:https://www.liquidweb.com/kb/install-ph ... ntu-18-04/
1)update the package index on your server with
Codice: Seleziona tutto
sudo apt update
Codice: Seleziona tutto
sudo apt install mysql-server
Run the security script:
Codice: Seleziona tutto
sudo mysql_secure_installation
In order to use a password to connect to MySQL as root, you will need to switch its authentication method from auth_socket to mysql_native_password. To do this, open up the MySQL prompt from your terminal:
Codice: Seleziona tutto
sudo mysql
Codice: Seleziona tutto
SELECT user,authentication_string,plugin,host FROM mysql.user;
Codice: Seleziona tutto
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
Then, run FLUSH PRIVILEGES which tells the server to reload the grant tables and put your new changes into effect:
Codice: Seleziona tutto
FLUSH PRIVILEGES;
Codice: Seleziona tutto
SELECT user,authentication_string,plugin,host FROM mysql.user;
Codice: Seleziona tutto
exit
Codice: Seleziona tutto
systemctl status mysql.service
For an additional check, you can try connecting to the database using the mysqladmin tool, which is a client that lets you run administrative commands. For example, this command says to connect to MySQL as root (-u root), prompt for a password (-p), and return the version.
Codice: Seleziona tutto
sudo mysqladmin -p -u root version
from https://www.digitalocean.com/community/ ... untu-18-04
installazione PMA
1)Update the apt package tool to ensure we are working with the latest and greatest.
Codice: Seleziona tutto
sudo apt update
Codice: Seleziona tutto
sudo apt upgrade
During this installation you’ll be asked for the webserver selection, we will select Apache2 and select ENTER.
Codice: Seleziona tutto
sudo apt install phpmyadmin php-mbstring php-gettext
Codice: Seleziona tutto
phpenmod mbstring
Codice: Seleziona tutto
sudo nano /etc/apache2/apache2.conf
Codice: Seleziona tutto
Include /etc/phpmyadmin/apache.conf
Codice: Seleziona tutto
systemctl restart apache2
from:https://www.liquidweb.com/kb/install-ph ... ntu-18-04/