By all accounts, a great city. Right up there in the "...age doth not wither, nor custom stale her infinite variety..." bracket [Aside: What other cities qualify? Damascus? Varanasi? Baghdad?]. Alexandria captures the imagination of peoples all around the world, in many different times and contexts. She (can a city be anything but a she?) has been used in history, wars, literature, poetry and so on.
Exhibit A - History & Conquest: a Macedonian yuppie created her, the Ptolemies and Cleopatra (Mykingdomforanos!) trod her streets (well, they were probably carried in a litter or something, but you get the picture), the Romans treasured her(but also massacred her children), Persians and Byzantines and Arabs conquered her, the Ottomans neglected her, Napoleon and the British bloodied the sands for her, Rommel tried to take her and failed... Clearly, a lot of to-ing and fro-ing for one bit of real estate.
Exhibit B - Literature: Perhaps we will speak only of the most famous work(s) about Alexandria: Lawrence Durrell's magnum opus, The Alexandria Quartet. While TAQ is populated by a set of fascinating characters, the city itself plays no small part in the tale, it is always there, lurking in the background, a canvas on which Durrell etches his sketches. Or whatever. The problem, of course, is that TAQ deals mostly with the lives of the Europeans and Westernized Egyptians of Alexandria, the hoi polloi don't make too many appearances. Nevertheless, all 4 books are eminently readable, employ some very clever narrative devices (in theory, you can read the first 3 books in any order you choose!), and must surely rank as one of the great literary achievements of the 20th century.
En passant, we may note that E.M.Forster lived and worked in Alexandria, and wrote Alexandria: A History And Guide.
Has Mahfouz written about Alexandria?
Exhibit C - Poetry: One name towers over the rest: Constantine P. Cavafy. Was born, and died, in Alex. More about him here. Although much of his work was not published when he was alive, it got people's attention when it was. Auden wrote an introduction to the English translations, and there is a Cavafy Museum in his city. Incidentally, Cavafy also lurks in the background in The Alexandria Quartet. The volumes are replete with references to "The Old Poet Of The City" and other such Voldemort type names, all referring to good 'ol Constantine.
About Alexandria and Egypt, there is much more to say,
But then the blog won't see, the light of the day,
To borrow a stanza, many poems rhyme
This one don't.