Closed Rehan587 closed 1 year ago
Does it work as root db user (mysqld -u root
)?
Have you set a password a root password as described in this issue or the wiki?
Does it work as root db user (
mysqld -u root
)? Have you set a password a root password as described in this issue or the wiki?
I don't remember having a password currently set for my account, so I'm not sure if i have one right now.
I'm getting this error if I try to run:
mysql -u root
after running mysqld_safe in earlier session
$ mysql -u root ERROR 1698 (28000): Access denied for user 'root'@'localhost
BTW is this a bug report? A bug report should always be accompanied by termux-info
output.
BTW is this a bug report? A bug report should always be accompanied by
termux-info
output.
Yup, forgot to put that. I'll put it in the main comment.
I don't remember having a password currently set for my account, so I'm not sure if i have one right now.
So try setting one as specified in the linked issue and wiki
# sources.list.d/game.list deb https://termux.org/game-packages-21-bin games stable # sources.list.d/science.list deb https://termux.org/science-packages-21-bin science stable
Why are you subscribed to repos for android 5&6? Using packages from there will not work and might mess up your environment. Remove them: pkg remove game-repo science-repo
, and/or rm $PREFIX/etc/apt/sources.list.d/{game,science}.list
I don't remember having a password currently set for my account, so I'm not sure if i have one right now.
So try setting one as specified in the linked issue and wiki
Tried, apparently, when trying to run mysql -u $(whoami)
, it logs me in as an anonymous user and stops me from doing basically anything. I also tried to login this time with mysql -u root -p
, which has also left me hanging. It asks for a password, and no matter what i try, it doesn't let me log in.
https://wiki.termux.com/wiki/MariaDB:
To enable access to root account, you need to login with your Termux user name
mysql -u $(whoami)
and manually change password for root
use mysql; set password for 'root'@'localhost' = password('YOUR_ROOT_PASSWORD_HERE'); flush privileges; quit;
Verify that you are able to login as 'root' with mysql -u root -p. You will need to provide password set in previous step.
Something perhaps changed. I don't see the mysql
db when log in as $(whoami)
and root account is locked.
Got it working after reinstalling DB with this command:
rm -rf $PREFIX/var/lib/mysql
mkdir -p $PREFIX/var/lib/mysql
mysql_install_db --user=root --auth-root-authentication-method=normal --datadir=$PREFIX/var/lib/mysql --basedir=$PREFIX
The postinst script for mariadb package should be adjusted.
Note: this change will deprecate instructions on Termux Wiki and one will have to just use mysql -u root
for login with no account manipulations after installation.
Update: fixed in https://github.com/termux/termux-packages/commit/4d5476cb5079eda1730f2d9f4b1b4a3fc22dcf59 (only fresh installations).
@sylirre @Grimler91 I tried to reproduce this with the latest mariadb
. Looks like the issue has disappeared. Everything working normally after installing database with:
mariadb-install-db --user=$(whoami)
Was able to follow the instructions on Wiki without encountering any errors.
~ $ termux-info
Termux Variables:
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~RnJacVAjilPCdKfIpzN6zA==/com.termux-vxYCkCMGQPntxWsJuEQA2Q==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=false
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-7
TERMUX_APP__PID=13538
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c225,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c225,c256,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10225
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.42.0
Android version:
12
Kernel build information:
Linux localhost 4.19.191-ge93b76eb4caa-dirty #1 SMP PREEMPT Tue Feb 20 15:35:07 CST 2024 aarch64 Android
Device manufacturer:
vivo
Device model:
V2204
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Greetings, I'm trying to use mariadb in termux, when trying to create a database, i get the following error
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'abc'
Steps to reproduce the bug:
Full error message:
Please help
Edit:
termux-info output