Comments (6)
That isn't fixing the issue for me it is only slightly changing the error message.
I destroyed my old jail and created a fresh one. After editing the socket parameter on my.cnf
here is the output.
root@tst:~ # /usr/local/bin/mysqld_safe --datadir='/var/db/mysql' &
[1] 95814
root@tst:~ # 200625 17:54:17 mysqld_safe Logging to '/var/db/mysql/tst.err'.
200625 17:54:17 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql
[1] Done /usr/local/bin/mysqld_safe --datadir=/var/db/mysql
root@tst:~ # mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61)
Enter current password for root (enter for none):
As you can see the only thing that has changed is the number at the end of the error changing from a 2 to a 61. I have tried several times and I get the same thing every time.
Here is my my.cnf
to show I have edited it correctly.
#
# This group is read both by the client and the server
# use it for options that affect everything, see
# https://mariadb.com/kb/en/configuring-mariadb-with-option-files/#option-groups
#
[client-server]
port = 3306
socket = /tmp/mysql.sock
#
# include *.cnf from the config directory
#
!includedir /usr/local/etc/mysql/conf.d/
from freebsd-nextcloud-setup-hardened.
Is this a brand new installation, or did you mount a non-empty directory into /var/db/mysql
?
from freebsd-nextcloud-setup-hardened.
Not sure if you saw my post on the forum yet. More information there.
https://www.ixsystems.com/community/threads/how-to-manually-install-nextcloud-on-freenas-in-an-iocage-jail-with-hardened-security.72016/page-7
To answer your question, this is a fresh jail. It is an old FreeNAS install (the latest version though) but that shouldn't affect a jail. The error is reproducible by destroying the old jail and creating a new one and re-entering the commands. I did just try to rm -r
the /var/db/mysql
directory then start mysql again, run the installation command again, and I still get the same error.
from freebsd-nextcloud-setup-hardened.
I've been able to replicate your issue. This is interesting; this must have just popped up in the past few days because I tested almost this exact configuration a number of times without issue. This was normally caused by having a non-empty /var/db/mysql/
directory. Regardless, I have a quick fix for you. To get the server started, there are a couple of things to do:
- Modify the 'socket' parameter in
/usr/local/etc/mysql/my.cnf
, and change it from/var/run/mysql/mysql.sock
to/tmp/mysql.sock
.This isn't strictly necessary if you change in remaining references in the guide to/var/run/mysql/mysql.sock
- Run
/usr/local/bin/mysqld_safe --datadir='/var/db/mysql' &
. This should get the server started, from which point you should be able to executemysql_secure_installation
and get everything configured. From here on,service mysql-server start
,stop
, andstatus
should be enough to manage the mysql service.
Hopefully this works for you. It did for me.
Edit: It is necessary to change the path in (1) to /tmp/mysql.sock. This is the path that mysql_secure_installation expects
from freebsd-nextcloud-setup-hardened.
I got it working. I didn't need /usr/local/bin/mysqld_safe --datadir='/var/db/mysql' &
. After editing the my.cnf
I just needed to service mysql-server start
, then mysql_secure_installation
, and it works.
Edit: Looks like the guide is already wording things correctly.
from freebsd-nextcloud-setup-hardened.
still having the issue. fresh jail 11.3
did
Modify the 'socket' parameter in /usr/local/etc/mysql/my.cnf, and change it from /var/run/mysql/mysql.sock to /tmp/mysql.sock
restarted mysql
-> not working, still error:
Enter current password for root (enter for none): ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) Enter current password for root (enter for none):
according to the destination in error msq it seems the path did not get respected.
verified socket in my.cnf and it is pointing to /tmp/..
any idea?
solved by:
$ service mysql-server start $ mysql_secure_installation --socket=/tmp/mysql.sock
from freebsd-nextcloud-setup-hardened.
Related Issues (19)
- Add upgrade steps to the guide
- Ordered list of backup requirements not rendered correctly
- MariaDB secure installation Error 2002 after modifying /usr/local/etc/mysql/my.cnf HOT 1
- Update mysql socket location HOT 1
- Web updater would give gateway timeouts when using reverse proxy
- User reports memcache.locking setting to Redis causes internal server error HOT 2
- Investigate use of app password for gmail for notifications HOT 1
- TrueNAS HOT 1
- Support links are out of date
- Create an iocage jail cmd always returns an error HOT 2
- Futureproof MariaDB install instructions.
- Test and confirm installation on FreeNAS 11.3 requires mod_rewrite
- fstab commands require destination directory to already exist
- Add reverse proxy as trusted domain in nextcloud conf
- DMZ & FreeBSD jail solution HOT 1
- You do not need PuTTy or Cygwin to ssh on Windows. OpenSSH is built in. HOT 2
- FreeNAS GUI Screenshots need to be updated HOT 1
- Nextcloud recommends running cron job every 5 minutes, not every 15 minutes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freebsd-nextcloud-setup-hardened.