Access denied After MySQL Manual Installation on Google Compute Engine - google-cloud-platform

Somehow I wanted to install MySQL manually, so I did as explained in How to Set Up MySQL on Google Compute Engine except that I didn't need to create a VM instance because I already have one.
That is, since my OS is 'Debian GNU/Linux 9 (stretch)', I executed the following two commands to install MySQL:
$ sudo apt-get update
and
$ sudo apt-get -y install mysql-server
There's no errors in this step and I created a root password by the following command:
$ sudo mysql_secure_installation
But when I tried to connect to MySQL, (entering the root password I created)
$ mysql --user=root --password
I've got
ERROR 1698 (28000): Access denied for user 'root'#'localhost'
What would be a problem here and what should I check in order to connect to MySQL?

There is an error on the tutorial. In order to connect to the MySQL you should run:
$ sudo mysql --user=root --password

Related

start cassandra on google cloud on debian vm

I have created a Debian VM and followed the steps to install cassandra on it. In the end, when I ran sudo apt update
sudo apt install cassandra
cassandra was installed and also automatically started.
However, cassandra wasn't added to PATH. I stopped cassandra using ps -aux|grep cassandra and kill pid. Now when I am trying to start it again using cassandra -f, I am getting several permission denied errors. eg
/usr/sbin/cassandra -f
OpenJDK 64-Bit Server VM warning: Cannot open file /var/log/cassandra/gc.log due to Permission denied
I can try using -R option and start Cassandra as root but it is not recommended. How can I start cassandra as normal user?

superset server not running

I am following the below instructions to install superset. In this step "superset runserver -d" getting an error below. How do I fix this issue. Thanks
[DEPRECATED] As of Flask >=1.0.0, this command is no longer supported, please use flask run instead, as documented in our CONTRIBUTING.md
[example]
flask run -p 8080 --with-threads --reload --debugger
# Install superset
pip install superset
# Create an admin user (you will be prompted to set a username, first and last name before setting a password)
fabmanager create-admin --app superset
# Initialize the database
superset db upgrade
# Load some data to play with
superset load_examples
# Create default roles and permissions
superset init
# To start a development web server on port 8088, use -p to bind to another port
superset runserver -d
Yesterday commit https://github.com/apache/incubator-superset/pull/5966 fixed similiar issue with docker install. Try to clone repo from scratch and go trough the following steps:
git clone https://github.com/apache/incubator-superset/
cd incubator-superset/contrib/docker
# prefix with SUPERSET_LOAD_EXAMPLES=yes to load examples:
docker-compose run --rm superset ./docker-init.sh
# you can run this command everytime you need to start superset now:
docker-compose up
New installation doc: https://github.com/apache/incubator-superset/blob/master/docs/installation.rst
Try the below steps:
$ pip install flask==1.0.0
$ pip install sqlalchemy==1.2.18
$ pip uninstall pandas
$ pip install pandas==0.23.4

-bash: createdb: command not found

I'm using a Mac and I already have installed PostgreSQL in my computer using the dmg provided by PostgreSQL (and not by Postgres.app).
I have installed it because I will go to use it with Django, and for to get the correct functionality with the framework, I had to do the next commands:
export PATH=/Library/PostgreSQL/9.5/bin/:"$PATH”
sudo ln -s /Library/PostgreSQL/9.5/lib/libssl.1.0.0.dylib /usr/lib
sudo ln -s /Library/PostgreSQL/9.5/lib/libcrypto.1.0.0.dylib /usr/lib
$ sudo mv /usr/lib/libpq.5.dylib /usr/lib/libpq.5.dylib.old
$ sudo ln -s /Library/PostgreSQL/9.5/lib/libpq.5.dylib /usr/lib
Then I executed the command:
./manage.py migrate
Getting at the terminal a message like this:
And knowing that I needed to create a user "erikb" in PostgreSQL.
I can enter in terminal the command:
sudo su - postgres
To enter to PostgreSQL, but when I wanted to create a DB o a new user, it sent me the next error: -bash: createuser: command not found
Does anyone know which could be the problem?
Regards.
You set the PATH variable in your user account, and then you su'd to a different user. That user does not inherit your environment, including your path.
You need to set the environment for that user, or else use the full path to the createdb command.
export PATH=/Library/PostgreSQL/9.5/bin/:$PATH
createdb erikb

setting up postgresql/constantly giving me error could not connect to server:

Hello I'm trying to use postgresql, on my digital ocean provided server.
I did $ sudo apt-get install postgresql then $ sudo su postgres then $ createuser -P djangousr but then now I get an error:
createuser: could not connect to database postgres: could not connect
to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I googled around but just couldn't find a solution. any help would be appreciated
Once you install the server, you have to configure it - it should have prompted to configure it for you. If it didn't, run the following command to reset the installation:
sudo apt-get update
sudo apt-get remove --purge postgresql
sudo apt-get install postgresql postgresql-contrib
Once they finish, then follow this tutorial. To test if everything is working, the following commands should get you to the postgresql shell:
sudo -i -u postgres
psql
Use \q to quit the shell.
I've run into this error, too. Try this command
ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432
This worked out for me... Hope that helps!

error: Please install the PostgreSQL server development packages and re-run configure

I am trying to install the Postgis on my ubuntu system for django framework. But everytime when i run the command ./configure it gives me error
error: the PGXS Makefile /usr/lib/postgresql/9.3/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure.
I have already installed postgres on my system and has also created the user. But i am unable to install the Postgis on my system. I have gone through the many instructions i found on Internet but failed to install it.
Please tell me the solution of this error so that i can install Postgis on ubuntu.
help will be highly appreciated
Assuming you're using PostgreSQL from http://apt.postgresql.org/ :
apt-get install postgresql-server-dev-9.3
While you're at it, as #BurhanKhalid points out, you should just be installing PostGIS from packages, rather than from source, as the PostGIS web page explains:
apt-get install postgis2_93
Install postgreSql
sudo apt-get install postgresql postgresql-contrib
Install Postgis.
sudo add-apt-repository ppa:gwibber-daily/ppa
sudo apt-get update
sudo apt-get install postgresql-9.3-postgis-2.1
sudo apt-get install postgresql-server-dev-9.3
create database in Postgresql
createuser -U postgres username -S -D -R
psql -U postgres -c "alter role username with password 'passhere';"
createdb -U postgres -T template_postgis -O username dbname
if you do not have the template_postgis in the postgresql then
switch to user postgres and run
sudo su postgres
createdb template_postgis
createlang plpgsql template_postgis
Now for creating the extansions
psql -d dbname -c "CREATE EXTENSION postgis;"
psql -d dbname -c "CREATE EXTENSION postgis_topology;"
For PostgreSQL 11, you need to install postgresql-11-postgis-2.5 and postgresql-11-postgis-2.5-scripts as described here.
sudo apt install postgresql-11-postgis-2.5
sudo apt install postgresql-11-postgis-2.5-scripts
just use this command :
sudo apt install postgis