我在Raspberry Pi 3 Model B上安装了Raspbian 2.4.4。我已经安装了MySQL服务器,客户端,Workbench以及monodevelop,nodejs Apache 2和php7.0以及我的应用程序所需的一些C / C ++包。
但是我无法从MySQL Workbench登录到我的MySQL服务器。我收到以下错误:
//create firebase reference
var dbRef = new Firebase('https://firebaseurl.firebaseio.com/');
var ref0 = dbRef.child('ref0');
var ref1 = dbRef.child('ref1');
var ref2 = dbRef.child('ref2');
var ref3 = dbRef.child('ref3');
var showAllRefs = ref0, ref1, ref2, ref3;
//load all contacts (limited to last 5 items)
showAllRefs.limitToLast(5).on("child_added", function(snap) {
snap.forEach(function(childSnapshot) {
var key = childSnapshot.key();
var childData = childSnapshot.val();
//create divs from database-elements
var card = document.createElement('div');
card.setAttribute('class', 'linkprev');
$('#content').prepend($(card));
var cardtitle = document.createElement('div');
cardtitle.setAttribute('class', 'cardtitle');
cardtitle.innerHTML = childData;
card.appendChild(cardtitle);
});
$(document).ready(function(){
document.guteUrls.execute('linkprev');
});
});
//save contact
//save in database contacts
var elements = $('.f');
//console.log(elements);
//save items to firebase(childs)
var buttonPressed = function( event ) {
event.preventDefault();
//url validation from inputfield using Regex
var valpattern = new RegExp('^(http|https)://'+ // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
'(\\#[-a-z\\d_]*)?$','i'); // fragment locator
var valselect = document.getElementById('url');
var val = valpattern.test(valselect.value);
//save in database to different childs on buttonclick
if(val && document.querySelector(".f1")){ref0.push({name: document.querySelector('#url').value})
contactForm.reset();}
else if(val && document.querySelector(".g1")){ref1.push({name: document.querySelector('#url').value})
contactForm.reset();}
else if(val && document.querySelector(".h1")){ref2.push({name: document.querySelector('#url').value})
contactForm.reset();}
else if(val && document.querySelector(".i1")){ref3.push({name: document.querySelector('#url').value})
contactForm.reset();}
else {
alert('Oops');}
};
for (var i = 0; i < elements.length; i++) {elements[i].addEventListener("click", buttonPressed, false);}
我引用了几篇文章,例如can't login as mysql user root from normal user account和Cannot connect to Database server (mysql workbench)。我试图进入MySQL命令提示符,但它往往打开MariaDB命令提示符。据我所知,我没有安装任何与Maria DB有关的内容。
Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access denied for user 'root'@'localhost'
Please:
1 Check that mysql is running on server localhost
2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the root has rights to connect to localhost from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you're connecting from