Maria DB Access Privileges - mariadb

I have created my Maria DB Instance under Centos 7 using the the following command
[username#localhost]$ sudo yum install mariadb-server
System Enabled and Started with the following Commands
sudo systemctl enable mariadb
sudo systemctl start mariadb
I have secured the installation with the following command
sudo mysql_secure_installation
The Server was secured and invoked the mysql prompt using
mysql -u root -p
There is no problem. I am able to use this command to get into SQL Command
However when I am trying to load tables, i am getting the following error
ERROR 1045 [28000]: Access Denied for user 'root#'localhost' (using
password: NO)
Unable to load data. What could be the solution
Thanks
Sreeram

Related

'Access denied for user 'user'#'localhost'

I am trying to create a sql user which has the sole role of performing the login procedure but I keep getting the same error: Access denied for user 'login'#'localhost' (using password: YES)
I created the user like this:
CREATE USER IF NOT EXISTS 'user'#'%' IDENTIFIED BY 'password';
GRANT EXECUTE ON procedure `table`.`login` TO 'user'#'%';
If I try to login via terminal or mysql workbench or use the mysql_real_connect() function in my C client, i always get the same error.
I solved it by reinstalling mariadb and using the following commands:
mysql_upgrade -u root -p
chown mysql:mysql /var/lib/mysql -R
systemctl enable mysqld
systemctl start mysqld
My system is arch linux, this can also be useful to better manage the installation of mysql or mariadb: https://wiki.archlinux.org/index.php/MySQL

OpenVAS installation and running errors

I've installed Greenbone Security Assistant Version 9.0.1 (OpenVAS) by this instruction on my VirtualBox's Ubuntu 20.4.
sudo apt install postgresql
sudo add-apt-repository ppa:mrazavi/gvm
sudo apt install gvm
greenbone-nvt-sync
sudo greenbone-scapdata-sync
sudo greenbone-certdata-sync
Unfortunately, it does not works.
When I'm trying to create a task by Wizard, I have the task completed just in moment, with an empty log. And that's all.
I've tried three commands:
systemctl status ospd-openvas # scanner
systemctl status gvmd # manager
systemctl status gsad # web ui
Everything is okay, except ospd-openvas. The status is green and active, but there are some errors too:
Jul 20 15:00:27 alex-VirtualBox ospd-openvas[833]: OSPD - openvas:
ERROR: (ospd_openvas.daemon) Failed to create feed lock file
/var/run/ospd/feed-update.lock. [Errno 2] No such file or directory:
'/var/run/ospd/feed-update.lock'
From the error message it looks like the directory /var/run/ospd/ does not exist.
Create the directory and try to restart the service.
In ubuntu 20.04 /var/run points to /run which is a temporary file system. That means that if you create the directory /var/run/ospd manually, it will be gone after the next reboot. To fix it permanently (in case the missing directory is the issue), please refer to this post.
This may help some people with some of the issues I've been facing:
mkdir -p /var/run/ospd/
touch /var/run/ospd/feed-update.lock
chown gvm:gvm /var/run/ospd/feed-update.lock

Fresh install: httpd.service: Unit not found

Currently I'm trying to follow this guide:
https://marxtudor.com/how-to-install-wordpress-using-ssh-on-centos-vps/
I'm using Google Cloud Platform (free edition to test) and I've created a fresh CentOS 7 VM. The guide above are the first commands I fill in and I keep getting this error:
I've followed so many tutorials, created a new VM and all the time I bump into this error that it doesn't know the httpd command.. I even deleted the project and started all over, but still no luck.
[rsa-key-XXXXXX]$ sudo service httpd restart
Redirecting to /bin/systemctl restart httpd.service
Failed to restart httpd.service: Unit not found.
[rsa-key-XXXXXX]$ httpd -t
-bash: httpd: command not found
[rsa-key-XXXXXX]$
Could anyone please let me know what could be causing this ?
Thanks in advance!
I was also getting the same error, this is how i resolved my issue.
After logging to the machine:
Step 1: Become the root user.
command: sudo su
Step 2: Update Kernal
command: yum update -y
Step 3: Install Apache command: yum install
httpd -y
Step 4: Start Apache command: service httpd start
Step 5: Check Status of Service command: service httpd status
This should solve your problem. good luck
Do you want to install WordPress for your Compute Engine VM instance, using CentOS 7?
If this is the case, you may do so by setting up LAMP for your VM, as described here [1], and then download the WordPress release of your choice [2] and install it on your VM.
I understand that you have successfully set up a VM instance using Centos 7, is this correct? Assuming this, and as you may see from [1], for CentOS 7, these would be the commands to perform this installation:
1) Update and install Apache and PHP:
sudo yum check-update
sudo yum -y install httpd php
2) Start the Apache service:
sudo service httpd start
sudo chkconfig httpd on
3) Install, configure and start DB:
sudo yum -y install httpd mariadb-server php php-mysql
sudo systemctl start mariadb
4) Configure MySQL (set a password for the root user if you want):
sudo mysql_secure_installation
5) Restart Apache
sudo service httpd restart
Once MySQL is set up, you will have to create a database for your WordPress installation.
Following this procedure, you will have Apache, MySQL and PHP installed and running on your Compute Engine VM instance.
Then, you can download the WordPress release of your choice [2], unzip the file and install WordPress by visiting your IP address and the folder where WordPress was downloaded. For example, http://YOUR_PUBLIC_VM_IP_ADDRESS/wordpress.
You will be asked for a database name, the user and password. This will allow WordPress to create the wp-config.php file on your behalf and proceed with the installation.
At this point, you should have WordPress already installed on your Compute Engine VM instance using CentOS 7.
An easier way to install WordPress on Compute Engine VM instances, would be by using the Marketpĺace in the Cloud Platform Console. Go to your Products and Services menu > Marketplace, and search for "Wordpress". You will be presented with many different options to launch WordPress in a Compute Engine VM instance. Nevertheless, it seems that Debian is the deafult OS used for these options.
Links:
[1] https://cloud.google.com/community/tutorials/setting-up-lamp
[2] https://wordpress.org/download/
In my case, I resolved it by looking what actual package name had "httpd" in it.
yum search httpd
It returned httpd.x86_64
Also, later on, when doing sudo service httpd start, I received the notification that PolicyKit1 was needed. So, all up, that command installed the package:
yum install -y httpd.x86_64 polkit-qt.x86_64
service httpd start

MariaDB is not working

I have installed mariadb using below commands:
yum install MariaDB-server MariaDB-client -y
But when execute commane:
service mysqld start
Error is coming:
mysqld: unrecognized service
Please let us know what wrong I am doing or what additionally I have to do to make it work.
Firstly verify that service sees MySQL using command:
sudo service --status-all
If you see MySQL there run command:
sudo service mysql start

MariaDB + phpmyadmin with Ngnix on ubuntu 14.04

I am trying to install phpmyadmin + mariadb.
My PHP configure string has the following mysql flags
CONFIGURE_STRING="--prefix=/etc/php7 --enable-mysqlnd --with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd <and other flags>"
I installed mariadb with the following:
sudo apt-get install mariadb-client mariadb-server
sudo mysql_secure_installation
I can login with a password via
sudo mysql -u root -p
Then I installed phpmyadmin with
cd /var/www/html
git clone --depth=1 --branch=STABLE https://github.com/phpmyadmin/phpmyadmin.git
mv phpmyadmin datastore #change name to datastore
When I open http://localhost/datastore I received the phpmyadmin login page; in attempt to login with root username and root password, i received the following error:
#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).
AND
mysqli_real_connect(): (HY000/2002): No such file or directory.
I am using php7 on ubuntu 14.04.
I wish to be able to connect mariadb and phpmyadmin.
Got some directions from Git on how to solve the problem and these are my steps, I feel someone may encounter the same challenge.
In phpmyadmin copy config.sample.inc.php into config.inc.php
sudo cp config.sample.inc.php config.inc.php
Check MariaDB status with STATUS;
MariaDB [(none)]>STATUS; [ENTER]
Check Connection - if localhost via Unix Socket then copy unix socket value.
Go to config.inc.php and force the following
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
Then change permission of config.inc.php in phpmyadmin
sudo chmod 0755 config.inc.php
Point your browser to phpmyadmin and login with your username and password.
Git link

Resources