Last active
May 23, 2022 06:04
-
-
Save vpnwall-services/3a71b7150275cff5625090724d48daf3 to your computer and use it in GitHub Desktop.
[MYSQL TO JSON] Mysql data to json #mysql #to #json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select JSON_OBJECT | |
('id', id, | |
'user_login', user_login, | |
'user_pass', user_pass, | |
'user_nicename', user_nicename, | |
'user_email', user_email, | |
'user_url', user_url, | |
'user_registered', user_registered, | |
'user_activation_key', user_activation_key, | |
'user_status', user_status, | |
'display_name', display_name) | |
from wp_users INTO OUTFILE '/root/wp_users.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GRANT FILE ON *.* TO 'user'@'localhost'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you so much
i feel so stupid now for complicating things
i was using group_concat on top of concating { + key + value }
this is so good and fast
edit - although it did not give a 100% result it skipped comma after every collection
( still thanks )