200614 02:29:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
200614 2:29:58 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
200614 2:29:58 [Note] Event Scheduler: Loaded 0 events
200614 2:29:58 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/run/mysql/mysql.sock' port: 3306 Source distribution
[root@Enki]# mysql -u root -p
Enter password: (my root password)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Your connection attempt failed for user 'root' to the MySQL server at xxx.xxx.xxx.xxx(my IP):3306
Host 'mypc' is not allowed to connect to this MySQL server
Please:
bunch of things to check
MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 5.1.73 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/run/mysql/mysql.sock MYSQL_INCLUDE -I/home/jcard/Alt-F/alt-f-sf/build/build_arm/staging_dir/usr/include/mysql MYSQL_LIBS -L/home/jcard/Alt-F/alt-f-sf/build/build_arm/staging_dir/usr/lib/mysql -lmysqlclient
Directive Local Value Master Value mysql.allow_local_infile On On mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket /var/run/mysql/mysql.sock /var/run/mysql/mysql.sock mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off
hello tinkerers1. I am trying to run mysql on DNS-323 to store long term logs from another piece of hardware.once I install the package
[root@DNS-320L]# rcmysqld stop # always use the rc<service> start|stop|status|eanble|disable...Stopping mysqld: OK.[root@DNS-320L]# rm -rf /var/lib/mysql # remove everything (if nothing added), first run will recreate them[root@DNS-320L]# rcmysqld startCreating MySQL system tables.../usr/bin/mysql_install_db: line 325: /usr/bin/hostname: not found
WARNING: The host '' could not be looked up with resolveip.This probably means that your libc libraries are not 100 % compatiblewith this binary MySQL version. The MySQL daemon, mysqld, should worknormally with the exception that host name resolving will not work.This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !Installing MySQL system tables...200618 3:36:07 [Warning] '--skip-locking' is deprecated and will be removed in a future relea
se. Please use '--skip-external-locking' instead.
OKFilling help tables...200618 3:36:09 [Warning] '--skip-locking' is deprecated and will be removed in a future relea
se. Please use '--skip-external-locking' instead.
OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:/usr/bin/mysqladmin -u root password 'new-password'/usr/bin/mysqladmin -u root -h password 'new-password'
Alternatively you can run:/usr/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.plcd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!Starting mysqld_safe: OK.
I was not able to run it giving me error that the port is already binded (probably because of sqlite that is required for lighttpd - more on that below)
rebooting the machine, solves the problem
the log file shows
200614 02:29:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
200614 2:29:58 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
200614 2:29:58 [Note] Event Scheduler: Loaded 0 events
200614 2:29:58 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/run/mysql/mysql.sock' port: 3306 Source distributionI connect to the box with putty using SSH, when I try to login
[root@Enki]# mysql -u root -p
Enter password: (my root password)I get :
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)then I tried to use MySQL Workbench (https://www.mysql.com/products/workbench/)I get:
Your connection attempt failed for user 'root' to the MySQL server at xxx.xxx.xxx.xxx(my IP):3306
Host 'mypc' is not allowed to connect to this MySQL server
Please:
bunch of things to checkQ1: How do I enable both local and remote access for 'root' ?
2. I thought of using phpMyAdmin
so installed lighttpd and enabled php, both are running well.in hello.php I see:
Q3: Can I switch lightpd to use mysql instead of sqlite (feels redundant having both servers running)
I have been scouring the internet for few hours trying to figure it out,but no successany tutorials or help in that regards highly appreciated.
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
ln -sf /bin/hostname /usr/bin/hostname
[mysqld]
port = 3306
socket = /var/run/mysql/mysql.sock
skip-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
bind-address = 0.0.0.0
login as: root
root@enki's password:
COLUMNS=80;LINES=60;export COLUMNS LINES;
[root@Enki]#
[root@Enki]#
[root@Enki]# rcmysqld stop
Stopping mysqld: OK.
[root@Enki]# rm -rf /var/lib/mysql
[root@Enki]# rcmysqld start
Creating MySQL system tables...
Installing MySQL system tables...
200618 10:33:31 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
200618 10:33:33 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password '
new-password'
/usr/bin/mysqladmin -u root -h Enki password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
Starting mysqld_safe: OK.
[root@Enki]# rcmysqld status
mysqld running
[root@Enki]# rcmysqld enable
Enabling boot execution of S44mysqld
[root@Enki]# /usr/bin/mysqladmin -u root password 'xxpassxx'
-sh: /usr/bin/mysqladmin: not found
[root@Enki]# /usr/bin/mysqladmin -u root password 'xxpassxx'
[root@Enki]# /usr/bin/mysqladmin -u root -h password 'xxpassxx'
/usr/bin/mysqladmin: connect to server at 'password' failed
error: 'Unknown MySQL server host 'password' (1)'
Check that mysqld is running on password and that the port is 3306.
You can check this by doing 'telnet password 3306'
[root@Enki]# cls
[root@Enki]# rcmysqld stop
Stopping mysqld: OK.
[root@Enki]# rm -rf /var/lib/mysql
[root@Enki]# rcmysqld start
Creating MySQL system tables...
Installing MySQL system tables...
200618 10:39:42 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
Filling help tables...
200618 10:39:44 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password '
new-password'
/usr/bin/mysqladmin -u root -h Enki password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
Starting mysqld_safe: OK.
[root@Enki]# /usr/bin/mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] n
... skipping.
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
[root@Enki]# rcmysqld start
Starting mysqld_safe: OK.
First enormous thank you Joao for everything ....I followed your instruction, keep in mind I am a windows guy, I know .... so embedded Linux is a real challenge for me...I did not get the host name error !!!
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h password 'new-password'this did not work so used :
Alternatively you can run:
/usr/bin/mysql_secure_installationand it worked I was able to set the root password, and login locally .... however I was unable to to log in remotely ... even after executing the host name correction that you suggested
ln -sf /bin/hostname /usr/bin/hostname
I scoured the internet, I found so many different things that I got lost ... things are not in the same place where the articles say the should be. for instance ... this article: https://linuxize.com/post/mysql-remote-access/
[root@DNS-320L]# mysql -p
Enter password:
...
mysql> insert into mysql.user values ('192.168.1.73','rroot','*467A21F53C095283DA1E0E990F2BCEDEF6EF8B00','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
mysql> flush privileges;
[root@DNS-320L]# mysqldump mysql user -p
Enter password:
...
INSERT INTO `user` VALUES ('localhost','root'...
...
jcard@yoga:~/> mysql -urroot -hdns-320l.homenet -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.1.73-log Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
# setup initial password for localhost ('popo' used as password in this scrip, change it )
# mysqladmin -u root password 'popo'
#
# or, when no initial password is yet setup, use this file 'mysql.txt'
# mysql -u root < mysql.txt
# which:
# -setup localhost password
# -delete test database
# -delete guest user
# -allow all remote connections
#
# or, if password is already set ('popo') use instead:
# mysql -u root -ppopo < mysql.txt
# notice that when using the '-p' option there must be no space to the password
use mysql;
# set password to 'popo'
update user set password=password('popo') where user='root';
# drop test database
drop database if exists test;
# and remove privileges on itdelete from db where db='test' or db='test\\_%';
# delete anonymous user
delete from user where user='';
# delete all allowed connections but localhost
delete from user where user='root' and host not in ('localhost', '127.0.0.1', '::1');
# duplicate root user to accept IP or wildcard (%) remote host connections
# using a IP is off by one, and using a FQDN hostname is not working (because of the IP bug?)
create temporary table temp_table select * from user where user='root' and host='localhost';
#update temp_table set host='yoga.homenet'; # use host name, not working
#update temp_table set host='192.168.1.73'; # use a host with IP 192.168.1.74
update temp_table set host='%'; # allow all remote connections
insert into user select * from temp_table;
drop table temp_table;
flush privileges;
# check from the cmd line after running this script:
# echo 'select user,host,password from user;' | mysql -ppopo mysql
#
# or from a remote host to the host named dns-320l running the mysqlserver:
# echo 'select user,host,password from user;' | mysql -u root -h dns-320l -ppopo mysql
echo 'select user,host,password from user;' | mysql -ppopo mysql
root localhost *68B1DEF0C1AE65E4A8A6C6E3B044F50AC71E30C9root 127.0.0.1 *68B1DEF0C1AE65E4A8A6C6E3B044F50AC71E30C9root % *68B1DEF0C1AE65E4A8A6C6E3B044F50AC71E30C9
Failed to connect to MySQL at
myAlt-F-IP:3306 with user root
Unable to connect to myAlt-F-IP:3306