Jump to content

mySQL server installation failed on ubuntu 18.04

mrchow19910319

* Guys sorry for the harsh tone I am just simply want to solve this issue asap.

 

Steps I took : 

sudo apt-get update
sudo apt-get install mysql-server

Errors I got : 

update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
dpkg: error processing package mysql-server-5.7 (--configure):
 installed mysql-server-5.7 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
                dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for systemd (237-3ubuntu10.39) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server

I did a simple google search about the main error

E: Sub-process /usr/bin/dpkg returned an error code (1)
Quote

 

it tells me there are a few ways to do a work around

I tried them all but they all did not work. 

 

 

On stackoverflow I saw this so I gave it a try: https://stackoverflow.com/questions/58961079/mysql-server-5-7-is-not-configured-yet

 

sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server


sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install


sudo apt install mysql-server

 

Still gives me the same error. 

What steps should I take now. 

 

 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

is it because I installed XAMPP before SQL server??? 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

It's possible that the mysql that comes with XAMPP is conflicting with the mysql you're trying to install. Specifically, the XAMPP mysql is blocking port 3306.

Try changing your XAMPP mysql port to some other value.

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Stu_Bear said:

I didn't know sql server would run on linux...wish i could help 

no worries dude

3 minutes ago, Trinopoty said:

It's possible that the mysql that comes with XAMPP is conflicting with the mysql you're trying to install. Specifically, the XAMPP mysql is blocking port 3306.

Try changing your XAMPP mysql port to some other value.

the thing is... I am doing all these because of this error I get from setting up october CMS... 

screencapture-localhost-buddhistblog-install-php-2020-02-21-03_26_59.thumb.png.21239b1e12ea4c757ef61a635af47594.png

 

is the mySQL in XAMPP and mySQL server I am installing the same thing??? 

I am confused... 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

tl;dr 

if i where you and i wanted to install sql on a linux server / pc 

i would just a tut that says which dependencies you need and what you have to install etc.

 

i bet you did that

 

if that would not work for me i would 1) use docker (i used marianaDB i think thats mysql?! and docker without any problems)

2) maybe check for Dockerfiles and just try to copy what they are doing line by line just on your host pc to install it

Link to comment
Share on other sites

Link to post
Share on other sites

Mostly yes. It'll probably be MariaDB instead of Mysql but they're compatible.

To get rid of the access denied error, go into your phpmyadmin and create a new user for your database that you can then use.

 

You can't feasibly connect to mysql that comes with XAMPP as the root user.

Link to comment
Share on other sites

Link to post
Share on other sites

Also, try setting the hostname to 127.0.0.1 instead of localhost. Yes, it makes a difference.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, KNG_HOLDY said:

tl;dr 

if i where you and i wanted to install sql on a linux server / pc 

i would just a tut that says which dependencies you need and what you have to install etc.

 

i bet you did that

 

if that would not work for me i would 1) use docker (i used marianaDB i think thats mysql?! and docker without any problems)

2) maybe check for Dockerfiles and just try to copy what they are doing line by line just on your host pc to install it

are you talking about the OctoberCMS thingy???

others suggested me using docker as well. but  I don't know how to... 

could you breifly explain to me what does it achieve when it comes to my using scenario.. 

 

What I was trying to do Using XAMPP and install OctoberCMS on it so I can set up a blog. 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

https://github.com/aspendigital/docker-octobercms#mysql--postgres

 

you could almost all server applications on docker

 

docker is like running a VM with less overhat 

just create a file with the name "docker-compose.yml"

and use the 2 cmd's below to start your container from inside the folder you created the docker-compose.yml in

docker-compose is the default name so you dont have to tell docker the name of the compose file

 

your docker file should contain 

 

edit:/ you prop want to save data on your host pc in that case you'll have to use volumes aswell

just read the whole readme in 

volumes:

- /x/:/y/

the first path is on your host system (/x/)

the second path is on your container (/y/)

 

your file should prop look something like this:

version: '2.2'
services:
  web:
    image: aspendigital/octobercms:latest
    ports:
      - 80:80
    environment:
      - DB_TYPE=mysql
      - DB_HOST=mysql #DB_HOST should match the service name of the database container
      - DB_DATABASE=octobercms
      - DB_USERNAME=root
      - DB_PASSWORD=root
      - TZ=America/Denver
    volumes:
      - /some/dir/on/your/host/pc/resizer:/var/www/html/plugins/aspendigital/resizer
      - /some/dir/.env:/var/www/html/.env
      - /some/dir/plugins:/var/www/html/plugins
      - /some/dir/storage/app:/var/www/html/storage/app
      - /some/dir/storage/logs:/var/www/html/storage/logs
      - /some/dir/storage/database.sqlite:/var/www/html/storage/database.sqlite
      - /some/dir/themes:/var/www/html/themes
  mysql:
    image: mysql:5.7
    ports:
      - 3306:3306
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=octobercms
    volumes:
      - /some/dir/where/you/want/to/safe/your/mysql/data/mysql:/var/lib/mysql

 

root as name & password is obv. not great if you ever want to expose your service

 

my writing is kinda clutterd so just ask follow up questions if i just ignored your question and wrote else :D

 

 

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

50 minutes ago, mrchow19910319 said:

I did a simple google search about the main error


E: Sub-process /usr/bin/dpkg returned an error code (1)

That won't take you anywhere, it's just a generic package manager error.

 

It seems you already have mysql installed with another method (which makes sense since you said you installed xampp) so the package manager doesn't know what to do. Check if mysql is already installed and if running with

systemctl status mysql

if it can't find the service then it's not installed and the problem must be elsewhere; if it's inactive, activate it with

sudo systemctl enable --now mysql

 

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, mrchow19910319 said:

the thing is... I am doing all these because of this error I get from setting up october CMS... 

Read the error message instead of trying to install second MySQL server. "Access denied" means that login to the database did not succeeded - like if the password is wrong (or like if root in XAMPP version of MySQL doesn't uses a password). Then "root" may have limited permissions and XAMPP expects you to create a new MySQL user via it panel.

Link to comment
Share on other sites

Link to post
Share on other sites

You should try to acess the database.. mysql -u root -p. if this doesen't work then set sudo infront of it, make a new user and create table for your CMS. Alot of people seem to have been "locked out of their databases".

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, AbsoluteFool said:

You should try to acess the database.. mysql -u root -p. if this doesen't work then set sudo infront of it, make a new user and create table for your CMS. Alot of people seem to have been "locked out of their databases".

this

and please change your username & password

dont use something like root:root :D

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, KNG_HOLDY said:

this

and please change your username & password

dont use something like root:root :D

username: password

password: password 

 

why? 

cos if those 2 were different it would be too hard to remember.

 

-- Big Head from Silicon Valley.

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

1. sudo apt install curl
2. curl -s https://octobercms.com/api/installer | php
 command php not found, can be installed with 
	sudo apt install php7.2-cli
	sudo apt install hhvm
3. sudo apt install php7.2-cli
zip archive is missing
4. sudo apt install php7.2-archive


successfully installed october CMS

5. Need to manually install mySQL 
sudo apt install mysql-server

6. after that I used `sudo mysql -u root -p` logged into the database and set the root user and password using :

`UPDATE mysql.user SET authentication_string = PASSWORD('12345') WHERE User = 'root';

7. Rebooted mysql using `FLUSH PRIVILEGES;`

8. I used this command to create a new database `CREATE DATABASE buddhistblog` 

9. Then I tried this command which is on OctoberCMS's official doc page: 

`php artisan october:install
`

then i got this error message : 


could not find driver(SQL:select * FROM information_schema.tables where table_schema=buddhistblog and table_name=migrations)
On 2/21/2020 at 6:56 PM, AbsoluteFool said:

You should try to acess the database.. mysql -u root -p. if this doesen't work then set sudo infront of it, make a new user and create table for your CMS. Alot of people seem to have been "locked out of their databases".

On 2/21/2020 at 7:02 AM, riklaunim said:

Read the error message instead of trying to install second MySQL server. "Access denied" means that login to the database did not succeeded - like if the password is wrong (or like if root in XAMPP version of MySQL doesn't uses a password). Then "root" may have limited permissions and XAMPP expects you to create a new MySQL user via it panel.

 

I have set up a virtual machine with Ubuntu 18.04. So I have a freshly installed Ubuntu system. 

Here are the steps I took

 

 

 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

sorry for the messed up format...

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

another question... why in my virtual machine when I go to localhost it says cannot be connected..... 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

do I need to install apache too ?

 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, mrchow19910319 said:

do I need to install apache too ?

 

An easier way would just be to sudo apt-get install lamp-server^, all CMS need a web server, so nginx, apache2, tomcat etc.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, AbsoluteFool said:

An easier way would just be to sudo apt-get install lamp-server^, all CMS need a web server, so nginx, apache2, tomcat etc.

will do.

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×