Warning: Mysqli - Connect : (HY000/1049) : Unknown Database in Mac Terminal Only
Warning: Mysqli - Connect : (HY000/1049) : Unknown Database in Mac Terminal Only
1. About
2. Products
3. For Teams
1. Log in Sign up
2.
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and
our Terms of Service.
1. Home
2.
1. PUBLIC
2. Stack Overflow
3. Tags
4. Users
5. FIND A JOB
6. Jobs
7. Companies
3.
1. TEAMS
What’s this?
2.
Free 30 Day Trial
Warning: mysqli_connect():
(HY000/1049): Unknown database in mac
terminal only
Ask Question
Asked 3 years, 1 month ago
Active 6 months ago
Viewed 28k times
4
2
in mac i want to create cronjob but when i run the php file with database i am getting error in
terminal.
Active OldestVotes
0
Is your PHP environment the same as your browsers PHP? command line php.ini can differ from,
for example, your XAMP or other installed webserver
export PATH=/Applications/MAMP/bin/php/php7.1.1/bin:$PATH
edit the path to your PHP bin from your XAMP
share improve this answer follow
edited Aug 31 '17 at 11:11
answered Aug 31 '17 at 11:04
dingezzz
4688 bronze badges
add a comment
11
check your port that mysql run . in many cases mysql run in port 3306 but in my mysql it run in
port 3308 and I add this:
kamyar
11111 silver badge44 bronze badges
add a comment
1
I had a similar problem. My code was like this:
Hayden Eastwood
78511 gold badge88 silver badges1616 bronze badges
answered Mar 8 at 10:18
Mabro DoubleC
1111 bronze badge
add a comment
0
In my case I got similar error
Mike
3,27744 gold badges1313 silver badges3030 bronze badges
answered Sep 25 '18 at 5:50
CoderSoup
111 bronze badge
add a comment
0
If you have this code:
Mujahid Bhoraniya
1
answered Feb 20 at 14:02
user2811
1
add a comment
Highly active question. Earn 10 reputation in order to answer this question. The reputation requirement helps
protect this question from spam and non-answer activity.
Not the answer you're looking for? Browse other questions tagged php mysql apache xampp or ask
your own question.
The Overflow Blog
Podcast 281: The story behind Stack Overflow in Russian
Failing over without falling over
Featured on Meta
When is a closeable question also a “very low quality” question?
Remote jobs
Shopify Developer
Tako AgencyNo office location
$55K - $73KREMOTE
htmljavascript
Full-Stack Engineer
Octane AINo office location
REMOTE
javascriptpython
View more jobs on Stack Overflow
Linked
0
How do I resolve this problem? "Warning: mysqli_connect(): (HY000/1049):
Related
1775
How do I get PHP errors to display?
831
How to fix “Headers already sent” error in PHP
1159
Reference - What does this error mean in PHP?
2154
How do I import an SQL file using the command line in MySQL?
49
Warning: mysqli_connect(): (HY000/2002): No such file or directory
3
SQLSTATE[HY000] [1049] Unknown database - Database created, not functioning
0
How do I resolve this problem? "Warning: mysqli_connect(): (HY000/1049):
Question feed
https://stack
STACK OVERFLOW
Questions
Jobs
Developer Jobs Directory
Salary Calculator
Help
Mobile
Disable Responsiveness
PRODUCTS
Teams
Talent
Advertising
Enterprise
COMPANY
About
Press
Work Here
Legal
Privacy Policy
Contact Us
STACK EXCHANGE
NETWORK
Technology
Life / Arts
Culture / Recreation
Science
Other
Blog
Facebook
Twitter
LinkedIn
Instagram
site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2020.10.26.37891