cf: https://upcloud.com/community/tutorials/installing-lamp-stack-ubuntu/
- sudo apt update
- sudo apt install apache
- sudo systemctl status apache2
- sudo apt install php7.4 php7.4-mysql php-common php7.4-cli php7.4-json php7.4-common php7.4-opcache libapache2-mod-php7.4
- sudo systemctl restart apache2
- sudo apt install mariadb-server mariadb-client
- sudo systemctl status mariadb
- sudo mysql_secure_installation
As you have no root password set for MariaDB you should simply press Enter when prompted, pressing Y on the next question to then set a root password (keep this safe and secure!) With that set, you can press Enter for the remaining questions as the defaults for each of these will help to secure your new installation. mysql_secure_installation
https://mariadb.com/kb/en/mysql_secure_installation/- Run mysql_secure_installation
- cf: https://kpchiaoo.blogspot.com/search?q=mysql
If can't access mysql as mysql user root from normal user account but can access mysql without mysql root password from ubuntu root accout, then follow the lines below (the parentheses are comments):
cf: https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04/801950
(1). su - (get into ubuntu root account)
(2). mysql -u root (get into mysql, should be no need password)
(3). select User,host,plugin from mysql.user;
(4). update mysql.user set plugin = 'mysql_native_password' where User='root';
(5). select User,host,plugin from mysql.user; (plugin column should be changed)
(6). SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new password');
or for mysql 8.0 in ubuntu 20.04
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassord'
(7). flush privileges; - sudo a2enmod userdir
- sudo a2enmod rewrite
- sudo vim php7.4.conf Commnent out the following lines:
#<IfModule mod_userdir.c>
# <Directory /home/*/public_html>
# php_admin_flag engine Off
# </Directory>
#</IfModule>
- sudo apt install phpmyadmin
- cf: https://stackoverflow.com/questions/42490647/phpmyadmin-installation-error-1045-acces-denied-using-password-no
$ mysql -u root -p
mysql> create database phpmyadmin;
mysql> create user 'phpmyadmin'@'localhost' identified by 'some_passwd';
mysql> grant all privileges on phpmyadmin.* to 'phpmyadmin'@'localhost'; cd
/usr/share/phpmyadmin/sql
$ mysql -u phpmyadmin -p phpmyadmin < create_tables.sqlEdit /etc/php/7.4/apache2/php.ini
post_max_size = 200M
upload_max_filesize = 200MEdit /etc/apache2/apache2.conf, add the lines:
<Directory /home/chiao/public_html/drupal9/web>
Options FollowSymLinks
AllowOverride AuthConfig FileInfo Indexes Limit Options=All,MultiViews
</Directory>sudo systemctl restart apache2
沒有留言:
張貼留言