Changes
From SME Server
Jump to navigation
Jump to search
← Older edit
Newer edit →
MySQL
(view source)
Revision as of 02:55, 19 August 2022
1,460 bytes added
,
02:55, 19 August 2022
→Restoring accidentally deleted MySQL root user
Line 76:
Line 76:
===Restoring accidentally deleted MySQL root user===
===Restoring accidentally deleted MySQL root user===
+
<tabs container style="display: inline-block;"><tab name="For SME 10">
+
mariadb 5.5 and up to 10.5
+
systemctl stop mariadb
+
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'`config get DomainName`' WITH GRANT OPTION;">/var/lib/mysql/set.rootuser
+
echo "GRANT PROXY ON ''@'' TO 'root'@'`config get DomainName`' WITH GRANT OPTION;">>/var/lib/mysql/set.rootuser
+
echo "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;">>/var/lib/mysql/set.rootuser
+
echo "GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION;">>/var/lib/mysql/set.rootuser
+
expand-template /root/.my.cnf
+
expand-template /var/lib/mysql/set.password
+
/usr/libexec/mysqld --socket=/var/lib/mysql/mysql.sock --bootstrap --user=mysql --skip-grant-tables <( cat /var/lib/mysql/set.rootuser /var/lib/mysql/set.password)
+
exit
+
systemctl start mariadb
+
</tab><tab name="For SME 8 and up to 9">
+
for MySQL 5.1.73
+
cd /var/service/mysqld
+
sv d .
+
echo 'use mysql;'>set.rootuser
+
echo "INSERT INTO `user` VALUES ('localhost','root','','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);">>set.rootuser
+
expand-template /root/.my.cnf
+
expand-template /var/service/mysqld/set.password
+
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.rootuser
+
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password
+
sv u .
+
</tab><tab name="For SME 7.3">
Note: The following is only applicable on SME 7.3 and MySQL 4.1
Note: The following is only applicable on SME 7.3 and MySQL 4.1
cd /var/service/mysqld
cd /var/service/mysqld
Line 87:
Line 111:
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password
sv u .
sv u .
+
</tab>
+
</tabs>
==MariaDB/MySQL fails to start==
==MariaDB/MySQL fails to start==
Unnilennium
Super Admin, Wiki & Docs Team,
Bureaucrats
,
Interface administrators
,
Administrators
3,258
edits
Navigation menu
Page actions
Page
Discussion
View source
History
Page actions
Page
Discussion
More
Tools
In other languages
Personal tools
English
Log in
Koozali SME Server
Main Page
Welcome
Releases
Testimonials
Documentation
SME Server FAQ
Volunteering
Commercial Support
Recent activities
Dashboard
Recent wiki changes
Recent bug changes
Unread Forum posts
Koozali resources
Contribs
How-To's
Forums
Bugzilla
Mailing Lists
Translations
Download
Koozali SME Server wiki
Wiki statistics
Wiki categories
Wiki Help
Koozali Wiki Help
Tools
Special pages
Printable version
Search