mysql: unrecognized service - mariadb

I followed the instruction here to install mariadb on WSL after following the steps. and I run this
sudo service mysql start
I got
mysql: unrecognized service
Any idea how to solve this?

It's just a simple problem as you see but it takes me 24 hours to diagnose the problem.
Solution:
I uninstall mariadb with this command
sudo apt-get remove --auto-remove mariadb-server
and install sudo apt install mysql-server instead but it leads to a more problems
Successfully install mysql but can't start
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
so by removing mariadb's deb sources and purging mysql-common and then reinstalling it.
do:
sudo apt edit-sources
and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main
comment it out by putting a # in front of it. then run
sudo apt update
sudo apt purge mysql-common
sudo apt install mysql-common
after that you can installed mysql-server properly via sudo apt install mysql-server, then do:
sudo apt purge mysql-server mysql-server-5.7
sudo apt purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rfv /etc/mysql /var/lib/mysql
sudo apt autoremove
sudo apt autoclean
Finally:
sudo apt update
sudo apt install mysql-server mysql-client --fix-broken --fix-missing
References:
https://askubuntu.com/questions/980314/cannot-install-mysql-server-in-ubuntu16-0-4
https://askubuntu.com/questions/763534/cannot-reinstall-mysql-server-after-its-purge

Which Linux distribution are you using on your WSL?
First, try the following:
systemctl {start|stop|restart|status} mysql
OR
service mysql {start|stop|restart|status}
to manage the MySQL service.
The reasons can be the following:
Wrong service name:
On some Linux distributions, the service is named as mysqld instead of mysql.
To check: Run chkconfig --list on your WSL and identify the correct service name.
File permission issues:
Please ensure that the files in /var/lib/mysql have 770 permissions and ownership set to mysql user.
To fix:
chmod -R 770 /var/lib/mysql
chgrp -R mysql /var/lib/mysql
In addition to that, ensure that the /etc/rc.d/init.d/mysqld script has executable permissions to modify mysqld.
To fix:
chmod 755 /etc/rc.d/init.d/mysqld
Missing/Corrupted MySQL server package:
Reinstall MySQL!

Related

How to install Swoole in ubuntu

Simply my Question is How to Install Swoole in Ubuntu 14.04 LTS
I have tried
sudo pecl install swoole
am getting handfull of errors, already posted here
Is there any alternate way to install the same...
Swoole Installation alternate ways
1.Install from source
sudo apt-get install php7-dev
git clone https://github.com/swoole/swoole-src.git
cd swoole-src
phpize
./configure
make && make install
2.Example for static compile
git clone -b PHP-7.2 --depth 1 https://github.com/php/php-src.git
cd php-src/
git clone -b master --depth 1 https://github.com/swoole/swoole-src.git ext/swoole
./buildconf --force
./configure --prefix=/usr/local/php7 --disable-all --enable-cli --disable-cgi --disable-fpm --disable-phpdbg --enable-bcmath --enable-hash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --enable-sockets --enable-pdo --with-sodium --with-password-argon2 --with-sqlite3 --with-pdo-sqlite --with-pcre-regex --with-zlib --with-openssl-dir --enable-swoole-static --enable-openssl --with-swoole
time make -j `cat /proc/cpuinfo | grep processor | wc -l`
sudo make install
Some Linux distributions do not include the PHP-XML extension in their PHP package and will need to be enabled before using PECL. You can install using apt-get install php-xml and you may need to install PHPize to compile Swoole, you can install it using apt-get install php7.*-dev or whatever PHP version you are using.
Then try again with sudo pecl install swoole
For those who installed PHP from ondrej/php PPA (quite common way to install PHP in Ubuntu) it's quite easy now:
sudo apt install php-swoole
Or for specific version:
sudo apt install php7.4-swoole
Tip. This is how you usually install ondrej/php PPA:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install swoole for version specific should work for example if you have php 7.3 use
sudo apt install php7.3-swoole
replace the version to your local php env

Log in RStudio with AWS EC2 instance

I managed to follow all the steps to create EC2 instance and install R Server on it.
But now when I go to RStudio to connect (which looks something like "ec2-[Public IP]-.eu-west-3.compute.amazonaws.com:8787")
I am asked a username and a password but I did not configure any:
I tried rstudio (username) and rstudio (password) but it does not work.
Anyone knows how I can find the username and the password to connect?
Thanks.
M
If this is using the AMI from http://www.louisaslett.com/RStudio_AMI/, the default password recently changed to the instance ID of the EC2. A code starting with i- and 17 alphanumeric characters, for example.
Username is still rstudio.
You can create a user/password in Linux and use it to log in
#add user(s)
useradd username
echo username:password | chpasswd
here is a detailed blog from on running R on AWS
I was having the same issue (I believe there is no ubuntu password for an AWS EC2 Instance and R studio requires one).
You can add a new user by typing the following: sudo adduser YOURUSERNAME and follow the terminal instructions (press enter to skip the info you do not want to give). Head over to the IP xxx.xxx.xxx.xxx:8787 and you should be able to log in now.
How to install R studio 3.4.4, upgrade to 3.6.0 and add a username (Ubuntu 18):
sudo apt update
sudo apt-get install -y r-base r-base-dev
sudo apt install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.2.1335-amd64.deb
sudo gdebi rstudio-server-1.2.1335-amd64.deb
sudo chmod 777 -R /usr/local/lib/R/site-library
sudo adduser YOURUSERNAME
#########
# Upgrade R
echo "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/" | sudo tee -a /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y r-base r-recommended r-base-dev
# Rstudio dependency issues (when installing devtools) - I installed from an AWS EC2 account so I need to change my root password.
sudo passwd root
su root
apt-get -y build-dep libcurl4-gnutls-dev

How to upgrade openresty with or without downtime

All,
I have few servers that have openresty installed and the version running on it is nginx version: openresty/1.9.7.2
How can i upgrade it to 1.11.5.2.
I have seen the documentation but things are not getting clear. Can someone please provide the detailed steps of the same.
This is a pretty late reply, but I just performed an upgrade from OpenResty 1.13.6.2 to 1.15.8.2. I'm running OpenResty in AWS/EC2 on Ubuntu 16.04.6 LTS. I just followed the Ubuntu guide to install at OpenResty
I did this on a backup instance to make sure everything worked, then applied the upgrade to my Live instance. All of my configs were intact and unchanged.
# install some prerequisites needed by adding GPG public keys (could be removed later)
sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates
# import our GPG key:
wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
# for installing the add-apt-repository
sudo apt-get -y install --no-install-recommends software-properties-common
# add the our official APT repository:
sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
# to update the APT index:
sudo apt-get update
# Then you can install openresty:
sudo apt-get -y install openresty
# check the new version:
openresty -v
# restart openresty
sudo service openresty restart

NginX still running when uninstalled it

I have tried to uninstall NGinX from my Ubuntu using following command:
sudo apt-get remove nginx-core nginx-full nginx-light nginx-extras nginx-common
I have used below command as well
sudo apt-get remove --purge nginx*
And still see below screen when I check NginX processes running.
What is happening??
Try to run sudo killall nginx.
Try to clear the web browser cache. It works for me.

opencpu cloud server installation guide on ubuntu 16.04

Would anyone know or like to share their note on installing opencpu cloud server on ubuntu 16.04?
I thought it is easy, but we saw many error here and there when following the instructions. I am new to opencpu. And, I don't have much experience on apache and nignx.
Here is the long story:
I created a new and clean ubuntu 16.04 server from microsoft azure vm, and installed opencpu cloud server following:
# Requires Ubuntu 14.04 (Trusty) or 16.04 (Xenial)
sudo add-apt-repository -y ppa:opencpu/opencpu-1.6
sudo apt-get update
sudo apt-get upgrade
# Installs OpenCPU server
sudo apt-get install -y opencpu
The server reported insserv error when running opencpu init script
update-rc.d: error: insserv rejected the script header dpkg
We then did some goolge and fix around, we got apache2 running, but when called:
curl http://localhost/ocpu/info
received 404 error.
FYI, the single user server runs fine.
The solution we found is that opencpu need mod_R to be turned on from apache2:
sudo a2enmod R
You need first to change to dir:
/etc/apache2/mods-available
And, make sure R.load file exists.
After running a2enmod command, should see a link to R.load (R module) in
/etc/apache2/mods-enable
Thank you y g for your question and response .. I had the same problem i try what you have mentioned in your comment but
curl http://localhost/cpu/info
takes along time without no response.
Thank you.
I used opencpu 1.5 works without bugs on ubuntu 16.04
sudo add-apt-repository -y ppa:opencpu/opencpu-1.5
sudo apt-get update
sudo apt-get upgrade
Install R and then install opencpu
sudo apt-get install r-base r-base-dev
sudo apt-get install -y opencpu
Also you should probably install Rstudio for IDE access
sudo apt-get install rstudio-server
To login to R you'll need to make a new user - follow the prompts
sudo adduser myname
Now just to make sure its all working
sudo service opencpu restart
sudo service rstudio-server restart
And try something like to check if its working
curl -L -v localhost/ocpu/library/
which should return a list of packages now installed on Ubuntu like this
Final Screenshot

Resources